0.0.6 • Published 10 years ago

wyv-json v0.0.6

Weekly downloads
3
License
ISC
Repository
github
Last release
10 years ago

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: ''
}
*/
0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago