Skip to content

Commit da4e7de

Browse files
committed
Improve readme to show modern js style
1 parent 81785a4 commit da4e7de

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

README.md

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,21 @@ Parameters that can be used (can be passed to the app server as GET query params
3939

4040
1. This library is published in npm you can use it as an npm module
4141

42-
```
43-
-shell-
44-
npm install osm-static-maps
45-
46-
-index.js-
47-
osmsm = require('osm-static-maps');
48-
osmsm({geojson: geojson})
49-
.then(function(imageBinaryBuffer) { ... })
50-
.catch(function(error) { ... })
51-
```
42+
```bash
43+
npm install osm-static-maps
44+
```
45+
46+
```javascript
47+
// index.js old school
48+
osmsm = require('osm-static-maps');
49+
osmsm({geojson: geojson})
50+
.then(function(imageBinaryBuffer) { ... })
51+
.catch(function(error) { ... })
52+
53+
// index.js modern style (also supports typescript)
54+
import osmsm from 'osm-static-maps'
55+
const imageBinaryBuffer = await osmsm({geojson})
56+
```
5257
5358
2. alternatively you can download the code, run the sample server and use it standalone (see How to run)
5459

0 commit comments

Comments
 (0)