normalize-pkg 
Normalize values in package.json to improve compatibility, programmatic readability and usefulness with third party libs.
Quickstart
Install with npm:
npm i -g normalize-pkg
Usage
Run normalize
in the command line to normalize the following properties in package.json
:
args
If you want to specify the source package.json
to normalize, or the destination to write to, you can use this format:
normalize [src] [dest]
Or explicit:
-s
| --src
: normalize the specified source file-d
| --dest
: write the file to the
Normalized values
Currently, only the following values are normalized. If any of the values is missing, a polite warning will be logged, but nothing will be modified.
license
If license
is formatted as a string:
{
"license": "MIT"
}
It will be normalized to:
{
"type": "MIT",
"url": "http://opensource.org/licenses/MIT"
}
license.url
is determined based on a search()
of the string, with basic support for the following:
bugs
If bugs
is formatted as a string:
{
"bugs": "https://github.com/assemble/generator-assemble/issues"
}
It will be normalized to:
{
"bugs": {
"url": "https://github.com/assemble/generator-assemble/issues"
}
}
author
If author
is formatted as a string:
{
"author": "Jon Schlinkert"
}
It will be normalized to:
{
"author": {
"name": "Jon Schlinkert",
"url": ""
}
}
repository
If repository
is formatted as a string:
{
"repository": "https://github.com/assemble/generator-assemble.git",
}
It will be normalized to:
{
"repository": {
"type": "git",
"url": "https://github.com/assemble/generator-assemble.git"
}
}
repository.type
is determined based on a search of the url
string.
Author
Jon Schlinkert
License
Copyright (c) 2014 Jon Schlinkert
Released under the MIT license
This file was generated by verb-cli on March 25, 2014.