
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
A node.js module for working with NYC's BYTES of the BIG APPLE datasets.
nyc-bytes
automatically downloads, extracts, and exposes a stream of objects from any of the supported datasets. Most datasets return object representations of the records. MapPluto returns GeoJSON Polygons
converted from New York - Long Island State Plane Coordinate System (NAD83) to standard Latitude/Longitude (WGS84) for easy mapping use. Requires Node v12 or above.
This library uses 7z
to unzip datasets. It must be installed and the command 7za
must be available in your environment's PATH
for it to work.
npm install nyc-bytes
Each dataset is exposed as a singleton object that must be initialized. This ensures that the underlying files are downloaded, extracted, and ready for use. Initializing the dataset returns a Promise
that returns once the dataset has finished initializing.
const Bytes = require('nyc-bytes');
const dataset = Bytes.Pluto;
// or const dataset = Bytes.MapPluto;
// or const dataset = Bytes.ZoningTaxLot;
// or const dataset = Bytes.PAD;
dataset.init().then(() => {
console.log('Dataset ready.');
const stream = dataset.stream();
// do something with stream
}).catch((err) => {
console.error(err);
});
The dataset's underlying data is accessible like any other standard node stream.
const stream = dataset.stream();
stream.on('readable', () => {
const record = stream.read();
// do something with the record
});
stream.on('end', () => {
console.log('finished');
});
You can also use the stream in flowing mode by attaching a data
event listener.
const stream = dataset.stream();
stream.on('data', (record) => {
// do something with the record
});
stream.on('end', () => {
console.log('finished');
});
Lastly, you can also pipe the stream like you would any other readable stream.
const stream = dataset.stream();
const writableStream = somehowGetWritableStream();
stream.pipe(writableStream);
table
- default: 'BOTH'
- Which table ('BBL'
|'ADR'
) to return (only applicable to PAD dataset)sanitize
- default: true
- Removes extra whitespaces. (only applicable to PAD dataset) Ex."EAST 45 STREET "
becomes
"EAST 45 STREET"
FAQs
A node.js module for working with NYC's BYTES of the BIG APPLE datasets.
We found that nyc-bytes 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.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.