Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
featureserver
Advanced tools
An open source implementation of the GeoServices specification
This is meant to be used as a plugin to Express
const express = require('express')
const app = express() // set up a basic express server
const featureServer = require('featureserver')
const cache = require('cache')
// We only need one handler because FeatureServer.route is going to do all the work
const handler = (req, res) => {
cache.get(/* some geojson */, (err, data) => {
if (err) res.status(500).json({error: err.message})
else FeatureServer.route(req, res, data)
})
}
// Sets up all of the handled routes to support `GET` and `POST`
const routes = ['/FeatureServer', '/FeatureServer/layers', '/FeatureServer/:layer', '/FeatureServer/:layer/:method']
routes.forEach(route => {
app.route(route)
.get(handler)
.post(handler)
})
Pass in an incoming request object
, an outgoing response object
and geojson
and this function will route and return a geoservices compliant response
Supports: '/FeatureServer', '/FeatureServer/layers', '/FeatureServer/:layer', '/FeatureServer/:layer/:method'
Note: only query
and info
are supported methods at this type
FeatureServer.route(req, res, data, options)
Data is a geojson object extended with some additional properties. These properties are optional and can be used to provide more specific metadata or to shortcut the built in filtering mechanism.
e.g.
{
type: 'FeatureCollection'
features: Array,
statistics: Object, // pass statistics to an outStatistics request to or else they will be calculated from geojson features passed in
metadata: {
name: String, //
extent: Object || Array // valid extent object or 2 coord array
id: String // unique identifier field
},
filtersApplied: {
geometry: Boolean, // true if a geometric filter has already been applied to the data
where: Boolean // true if a sql-like where filter has already been applied to the data
}
count: Number // pass count if the number of features in a query has been precalculated
}
Pass in geojson
and a valid geoservices query object
e.g. where=OBJECTID>10
and the function will perform the query and return a valid geoservices query object
FeatureServer.query(geojson, options)
Generate version 10.21
Geoservices-like server info
FeatureServer.serverInfo()
Generate version 10.21
Geoservices-like information about a single layer
FeatureServer.layerInfo(geojson, options)
Generate version 10.21
Geoservices-like information about one or many layers
Can pass a single geojson object or an array of geojson objects
FeatureServer.layers(geojson, options)
[1.0.10] - 2017-02-06
FAQs
*An open source implementation of the GeoServices specification*
The npm package featureserver receives a total of 143 weekly downloads. As such, featureserver popularity was classified as not popular.
We found that featureserver demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.