Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
module to manage a package.json for Simple Data Format packages
branch: master

Merge pull request #1 from standard-analytics/default-license

default license more adapted to data + fix init in CLI + edit in README
latest commit a4e35204ae
Max Ogden authored

readme.md

datapackage-json

module to manage a package.json for Simple Data Format packages

installation

NPM

npm install datapackage-json -g

usage

datapackage-json init
datapackage-json default

default generates a default package.json from the prompt script without using a prompt (just gets default values)

init asks the user for values and creates a package.json from it

api

var pkg = datapackage([dir, promptFile])

both arguments are optional. promptFile must be a PromZard prompt script, dir is the folder where the magic should happen, default is cwd.

pkg.read([cb])

reads package.json in pkg.dir, calls cb with (err, json)

pkg.init([opts, cb])

prompts CLI user using promzard for package.json fields, and then writes the result out to package.json

if opts.defaults is true it will bypass the promzard prompt and just write a default package.json

calls optional cb with (err, data) where data the package object that was just written to the fs

pkg.default(callback)

generates a default package.json from the prompt script without using a prompt (just gets default values)

calls callback with (err, defaults)

pkg.write(obj, [saveTarget, cb])

takes obj and writes it as a nicely formatted JSON object to saveTarget (default saveTarget is just ./package.json). calls optional cb with (err)

license

BSD

Something went wrong with that request. Please try again.