# geojson-parser-js

> A node.js/typescript library to generate and validate geojson string or parse geometries from the geojson file

Latest version **1.0.13** (published 2020-04-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install geojson-parser-js
pnpm add geojson-parser-js
yarn add geojson-parser-js
bun add geojson-parser-js
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.13 |
| Published | 2020-04-15 |
| First published | 2019-06-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 34.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Shubh Gupta |
| Maintainers | shubhgupta |
| Keywords | geojson |

## Links

- npm: https://www.npmjs.com/package/geojson-parser-js
- Repository: https://github.com/shubhgupta4u/geojson-parser-js
- Homepage: https://github.com/shubhgupta4u/geojson-parser-js#readme
- Issues: https://github.com/shubhgupta4u/geojson-parser-js/issues
- npm.io page: https://npm.io/package/geojson-parser-js

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.13 (latest) — 2020-04-15
- 1.0.12 (stable) — 2019-08-15
- 1.0.11 — 2019-08-15
- 1.0.10 — 2019-08-12
- 1.0.9 — 2019-07-07
- 1.0.8 — 2019-06-07
- 1.0.7 — 2019-06-07
- 1.0.6 — 2019-06-07
- 1.0.5 — 2019-06-04
- 1.0.4 — 2019-06-03
- 1.0.3 — 2019-06-03
- 1.0.2 — 2019-06-02
- 1.0.1 — 2019-06-02
- 1.0.0 — 2019-06-02

## README

# geojson-parser-js
A Node.js module to generate a geojson or validate it. This module also let you easily parse geometries from geojson.
## Installation 
```sh
npm install geojson-parser-js --save
yarn add geojson-parser-js
bower install geojson-parser-js --save
```
## Demo 
```sh
You can use the demo at https://www.geojson.in/
```
## Usage
### TypeScript  
```typescript
import {Geojson} from 'geojson-parser-js';
var isValid = Geojson.isValid({ "type": "FeatureCollection",  "features": [] });
```
```sh
Output should be 'true'
```
```typescript
import {Geojson} from 'geojson-parser-js';
import { FeatureCollection, GeometryType, FeatureProperty, Coordinate, Geometry, Point, LineString, Polygon, PolygonWithHole, MultiPoint, MultiLineString, MultiPolygon } from 'geojson-parser-js/models/geojson';
let features:FeatureCollection = Geojson.parse('{ "type": "FeatureCollection",  "features": [] }');
```
```sh
Output should be an instance of FeatureCollection class
```
```typescript
import {Geojson} from 'geojson-parser-js';
import { FeatureCollection } from 'geojson-parser-js/models/geojson';
let geoJsonStr:string = Geojson.create(features);
```
```sh
Input should be an instance of FeatureCollection
Output should be an Geojson string
```
### Javascript
```javascript
var geojson = require('geojson-parser-js');
var isValid = geojson.isValid('{ "type": "FeatureCollection",  "features": [] }');
```
```sh
Output should be 'true'
```
```javascript
var geojson = require('geojson-parser-js');
var features = geojson.parse('{ "type": "FeatureCollection",  "features": [] }');
```
```sh
Output should be an instance of FeatureCollection class
```
```javascript
var geojson = require('geojson-parser-js');
var geojsonStr = geojson.create(features);
```
```sh
Input should be an instance of FeatureCollection
Output should be an Geojson string
```
### AMD
```javascript
define(function(require,exports,module){
  var parser = require('geojson-parser-js');
});
```
## Test 
```sh
npm run test
```
### Support
```Bug or Suggestion Reporting
You can directly send any bug/issue or suggestion to my personal email id: shubhgupta4u@gmail.com.
```

---
_Source: https://npm.io/package/geojson-parser-js · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
