Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

arcgis-parser

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arcgis-parser - npm Package Compare versions

Comparing version 1.0.2 to 2.0.0

arcgis-parser.js

4

CHANGELOG.md
# Changelog
## 2.0.0 - 2017-09-29
- Support ES modules
## 1.0.1 - 2017-09-22

@@ -4,0 +8,0 @@

39

index.js

@@ -1,24 +0,27 @@

const get = require('./src/get')
const format = require('./src/format')
const metadata = require('./src/metadata')
import parseService from './src/parse-service'
import parseLayer from './src/parse-layer'
import parseUrl from './src/parse-url'
/**
* Get Metadata from ArcGIS REST Service
* ArcGIS Parser
*
* @param {string|Object} options Options
* @param {string} [options.url] Url
* @param {Protocol} [options.protocol='https'] Protocol
* @param {string} [options.host='services.arcgisonline.com'] Host
* @param {string} [options.pathname='/arcgis/rest/services/{service}/MapServer'] Pathname
* @param {Object} [options.query={f: 'pjson'}] Query
* @param {string} [options.service] ArcGIS Service Name
* @returns {Promise<Metadata>} Metadata
* @param {Object} json MapServer or ImageServer JSON
* @param {string} url ArcGIS REST service url
* @returns {Metadata} Metadata
* @example
* const metadata = await arcgisParser({service: 'World_Imagery'})
* const url = 'https://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer?f=pjson'
* const response = await fetch(url)
* const json = await response.json()
* const metadata = arcgisParser(url, json)
* //=metadata
*/
module.exports = function (options) {
const url = format(options)
return get(url)
.then(json => metadata(url, json))
.catch(error => { throw new Error(error) })
export default function arcgisParser (url, json) {
if (!url) throw new Error('url is required')
if (!json) throw new Error('json is required')
return {
service: parseService(json),
layer: parseLayer(url, json),
url: parseUrl(url, json)
}
}
{
"name": "arcgis-parser",
"version": "1.0.2",
"version": "2.0.0",
"description": "Parser for ArcGIS REST Services to human friendly JSON.",
"main": "index.js",
"main": "arcgis-parser.js",
"module": "index.js",
"jsnext:main": "index.js",
"types": "index.d.ts",

@@ -10,7 +12,9 @@ "files": [

"index.d.ts",
"arcgis-parser.js",
"src"
],
"scripts": {
"test": "tap src/**.test.js test.js --coverage",
"lint": "standard"
"pretest": "rollup -c rollup.config.js",
"test": "node -r @std/esm test/**.test.js",
"posttest": "standard src/**.js"
},

@@ -29,12 +33,15 @@ "author": "Denis Carriere <@DenisCarriere>",

"devDependencies": {
"load-json-file": "^3.0.0",
"standard": "^8.6.0",
"tap": "^10.7.2",
"tape": "^4.6.3",
"write-json-file": "^2.2.0"
"@std/esm": "*",
"node-fetch": "*",
"standard": "*",
"tap": "*"
},
"dependencies": {
"global-mercator": "^2.8.4",
"slippy-tile": "^2.3.1"
"global-mercator": "*",
"slippy-tile": "*"
},
"@std/esm": {
"esm": "js",
"cjs": true
}
}

@@ -32,11 +32,7 @@ # ArcGIS Parser

```javascript
const fs = require('fs')
const xml = fs.readFileSync('ogc-wmts.xml', 'utf8')
const capabilities = ogcParser.wmts(xml)
capabilities.service.type
//=OGC WMTS
capabilities.service.version
//=1.0.0
capabilities.url.getCapabilities
//=http://localhost:80/WMTS/1.0.0/WMTSCapabilities.xml
const url = 'https://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer?f=pjson'
const response = await fetch(url)
const json = await response.json()
const metadata = arcgisParser(url, json)
//=metadata
```

@@ -43,0 +39,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc