wyv-json

0.0.6 • Public • Published

wyv.json

wyv.json definition and parser

Properties

Required

  • name (string) – Name of module.
  • version (string) – Version of module. Follow specifications of semver.

Optional

  • author (string/object) – Similar to package.json
  • bugs (url) – Website URL where people can report issues.
  • contributors (array of strings/objects) – List of authors. Similar to package.json
  • dependencies (object)
  • description (string) – Description of the module.
  • homepage (url) – Official website of the module.
  • keywords (array of strings) – Keywords related or descriptive of the module. List maximum 5 keywords with the most important first.
  • license (string) — License of the module. Select an Identifier from the SPDX License List.
  • private (boolean) — Set to true if you do not want to accidentally publish the module.
  • repository (url) — URL of repository. Currently accepts Git only.

Methods

toJSON([isComplete])

Returns a JSON object containing only wyv.json properties and values.

var WyvJson = require('wyv-json');
 
var j = new WyvJson({
    "name": "test-module",
    "author": "John Doe <johndoe@localhost.com>",
    "version": "0.0.1"
});
 
console.log(j.toJSON());
/*
{
    name: 'test-module',
    version: '0.0.1',
    author: {
        name: 'John Doe',
        email: 'johndoe@localhost.com',
        url: ''
    },
    private: false
}
*/

If isComplete is set to true, this will also include empty properties.

console.log(j.toJSON(true));
/*
{
    name: 'test-module',
    version: '0.0.1',
    author: {
        name: 'John Doe',
        email: 'johndoe@localhost.com',
        url: ''
    },
    bugs: '',
    contributors: [],
    dependencies: {},
    description: '',
    homepage: '',
    keywords: [],
    license: '',
    private: false,
    repository: ''
}
*/

Readme

Keywords

Package Sidebar

Install

npm i wyv-json

Weekly Downloads

0

Version

0.0.6

License

ISC

Last publish

Collaborators

  • hyubs