
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
shp-write-new-prj
Advanced tools
write shapefiles from pure javascript, bug #48 fixed, latest version of jszip is used, and projection is set to 3857
Writes shapefile in pure javascript. Uses dbf for the data component, and jsZIP to generate ZIP file downloads in-browser.
For node.js or browserify
npm install --save shp-write
Or in a browser
https://unpkg.com/shp-write@latest/shpwrite.js
var shpwrite = require('shp-write');
// (optional) set names for feature types and zipped folder
var options = {
folder: 'myshapes',
types: {
point: 'mypoints',
polygon: 'mypolygons',
line: 'mylines'
}
}
// a GeoJSON bridge for features
shpwrite.download({
type: 'FeatureCollection',
features: [
{
type: 'Feature',
geometry: {
type: 'Point',
coordinates: [0, 0]
},
properties: {
name: 'Foo'
}
},
{
type: 'Feature',
geometry: {
type: 'Point',
coordinates: [0, 10]
},
properties: {
name: 'Bar'
}
}
]
}, options);
// triggers a download of a zip file with shapefiles contained within.
download(geojson)Given a GeoJSON FeatureCollection as an object, converts convertible features into Shapefiles and triggers a download.
write(data, geometrytype, geometries, callback)Given data, an array of objects for each row of data, geometry, the OGC standard
geometry type (like POINT), geometries, a list of geometries as bare coordinate
arrays, generate a shapfile and call the callback with err and an object with
{
shp: DataView(),
shx: DataView(),
dbf: DataView()
}
zip(geojson)Generate a ArrayBuffer of a zipped shapefile, dbf, and prj, from a GeoJSON object.
FAQs
write shapefiles from pure javascript, bug #48 fixed, latest version of jszip is used, and projection is set to 3857
We found that shp-write-new-prj demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.