
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
reference-spec-reader
Advanced tools
Experimental parser for [`ReferenceFileSystem` description](https://github.com/intake/fsspec-reference-maker). This repository also provides a `ReferenceStore` implementation, a storage backend for [`Zarr.js`](https://github.com/gzuidhof/zarr.js). An exam
Experimental parser for ReferenceFileSystem description.
This repository also provides a ReferenceStore implementation, a storage backend for
Zarr.js. An example of the V1 specification (JSON) is shown
below:
{
"version": 1,
"templates": {
"u": "server.domain/path",
"f": "{{ c }}"
},
"gen": [
{
"key": "gen_key{{ i }}",
"url": "http://{{ u }}_{{ i }}",
"offset": "{{ (i + 1) * 1000 }}",
"length": "1000",
"dimensions": {
"i": { "stop": 5 }
}
}
],
"refs": {
"key0": "data",
"key1": ["http://target_url", 10000, 100],
"key2": ["http://{{ u }}", 10000, 100],
"key3": ["http://{{ f(c='text') }}", 10000, 100],
"key4": ["http://{{ f(c='text') }}"]
}
}
#parse(spec[, renderString]) · Source
Parses both v0 and v1 references into Map<string, Ref>. A Ref is a union type of the following:
string: Inline ascii/base64 encoded data.[url: string]: A url for a whole file.[url: string | null, offset: number, length: number]: A tuple describing a binary section of a url.const spec = await fetch('http://localhost:8080/ref.json').then(res => res.json());
const ref = parse(spec);
console.log(ref);
// Map(9) {
// 'key0' => 'data',
// 'key1' => [ 'http://target_url', 10000, 100 ],
// 'key2' => [ 'http://server.domain/path', 10000, 100 ],
// 'key3' => [ 'http://text', 10000, 100 ],
// 'key4' => [ 'http://text' ],
// 'gen_key0' => [ 'http://server.domain/path_0', 1000, 1000 ],
// 'gen_key1' => [ 'http://server.domain/path_1', 2000, 1000 ],
// 'gen_key2' => [ 'http://server.domain/path_2', 3000, 1000 ],
// 'gen_key3' => [ 'http://server.domain/path_3', 4000, 1000 ],
// 'gen_key4' => [ 'http://server.domain/path_4', 5000, 1000 ]
// }
This library includes a minimal built-in render method to render jinja-templates included in the v1 spec.
This method can be overriden by providing a custom renderString function as a second argument.
import nunjucks from 'nunjucks';
const spec = await fetch('http://localhost:8080/ref.json').then(res => res.json());
const ref = parse(spec, nunjucks.renderString);
# ReferenceStore.fromJSON(data, [, options]) · Source
A Zarr.js store reference implementation. Uses fetch API.
v0 or v1 reference specification.renderString function.// create store from an input JSON string (v0 references).
ReferenceStore.fromJSON(`{"key0":"data","key1":"base64:aGVsbG8sIHdvcmxk"}`);
// create a store from an input JSON string loaded from `url`
ReferenceStore.fromJSON(await fetch(url).then(res => res.text()));
// create a store from an input JSON object loaded from `url`
ReferenceStore.fromJSON(await fetch(url).then(res => res.json()));
// create a store from an input JSON object loaded from `url` with default binary target
const res = await fetch('http://localhost:8080/data.tif.json');
ReferenceStore.fromJSON(await res.json(), { target: 'http://localhost:8080/data.tif' });
This package is written as a pure ES Module and is intended for use in various JavaScript
runtimes. It can be imported from a CDN via URL directly, or installed as a dependency
from pnpm for use in Node.js or via a bundler.
// Browser or Deno via a CDN
import { ReferenceStore, parse } from 'https://cdn.skypack.dev/reference-spec-reader@<version>';
// Node.js or bundler
import { ReferenceStore, parse } from 'referece-spec-reader';
I welcome any input, feedback, bug reports, and contributions. This project requires Node.js (version 12 or later) for running the test suite and linting/formating the code.
cd reference-spec-reader
pnpm install
pnpm test # runs unit tests only
pnpm run test:ci # runs CI test suite (type-checking, linting, and unit tests)
NOTE: If making a PR, please run
pnpm fmtto auto-format your changes. The linting check will fail for unformatted code.
FAQs
Experimental parser for [`ReferenceFileSystem` description](https://github.com/intake/fsspec-reference-maker). This repository also provides a `ReferenceStore` implementation, a storage backend for [`Zarr.js`](https://github.com/gzuidhof/zarr.js). An exam
The npm package reference-spec-reader receives a total of 134,457 weekly downloads. As such, reference-spec-reader popularity was classified as popular.
We found that reference-spec-reader 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

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.