
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
datapackage-read
Advanced tools
This is a module that reads datapackage.json files. It validates some stuff, and loads some default things.
npm install datapackage-read
The following assume you've required datapackage as follows:
var datapackage = require('datapackage-read');
datapackage.load(path, callback)
path
{String} The path to the Data Package directory or the
datapackage.json fileLoad a datapackage.json from a file and normalize it as per the normalize function. Will search for README at README.md in same directory as datapackage.json.
datapackage.loadUrl(urlToDataPackage, callback)
urlToDataPackage
{String} url to datapackage.json or directory in which
datapackage.json contained (also handle provision of github urls e.g.
https://github.com/datasets/gold-prices)Load a datapackage.json from a URL, related files (e.g. README.md) and normalize it
datapackage.normalize(datapackage, url)
datapackage
: datapackage.json object (already parsed from JSON)url
: [optional] url to datapackage.json or the root directory in which it
is contained online. Used to help auto-generate things homepageNormalize a DataPackage DataPackage.json in various ways, for example:
datapackage.parseSpecString(specString)
Parse a Data Package Spec string to a Spec object/dictionary. (See below for more on Data Package Specs).
A Data Package "Spec" is a small Object/Hash which describing the identify and location of a Data Package. Its structure is like:
{
url: ...
name: ...
version: ...
}
It can be parsed (and less importantly) serialized to a simple string. Spec strings will be frequently used on e.g. the command line to identify a data package.
A spec string can be:
A direct URL to a datapackage e.g.
http://mywebsite.com/mydatapackage/
// or with the datapackage.json
http://mywebsite.com/mydatapackage/datapackage.json
A github URL
http://github.com/datasets/gold-prices
A single name
gold-prices
In this case the data package must be in the core datasets in the primary registry.
Run the tests with:
npm test
FAQs
Read Data Packages
We found that datapackage-read 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 Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
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.