geojsonfile

1.0.0 • Public • Published

geojsonfile

Manage a Feature Collection in a JSON file.

npm travis standard conduct

Install

npm install --save geojsonfile

Usage

var turf = require('@turf/helpers')
var geojsonfile = require('geojsonfile')

var filepath = path.join(__dirname, 'data.json')
var file = geojsonfile(filepath)

file.put('coolgeojsonpoint', turf.point([-122, 32]), function (err) {
  file.get('coolgeojsonpoint', function (err, data) {
    console.log('data', data)
  })
})

Alternate fs module

Use an alternate fs implementation like hyperdrive by passing it in as an option:

var turf = require('@turf/helpers')
var geojsonfile = require('geojsonfile')
var hyperdrive = require('hyperdrive')

var filepath = path.join(__dirname, 'data.json')
var drive = hyperdrive(require('random-access-memory'))

// Use the hyperdrive instance:
var file = geojsonfile(filepath, { fs: drive })

Contributing

Contributions are welcome! Please read the contributing guidelines first.

Conduct

It's important that this project contributes to a friendly, safe, and welcoming environment for all, particularly for folks that are historically underrepresented in technology. Read this project's code of conduct

License

ISC

Dependencies (5)

Dev Dependencies (8)

Package Sidebar

Install

npm i geojsonfile

Weekly Downloads

1

Version

1.0.0

License

ISC

Last publish

Collaborators

  • sethvincent