normalize-license-data

1.0.1 • Public • Published

normalize-license-data

clean up licenses from package.json files and the npm registry

Installation

Download node at nodejs.org and install it, if you haven't already.

npm install normalize-license-data --save

Usage

var normalize = require("normalize-license-data")
 
normalize(null)
// => null
 
normalize('')
// => null
 
normalize('MIT')
// => {name: 'MIT', url: 'http://opensource.org/licenses/MIT'}
 
normalize('BSD')
// => {name: 'BSD', url: 'http://opensource.org/licenses/BSD-2-Clause'}
 
normalize('unfamiliar')
// => {name: 'unfamiliar'}
 
normalize({name: 'wtfpl', url: 'https:///wtfpl.net'})
// => {name: 'wtfpl', url: 'https:///wtfpl.net'}
 
normalize({type: 'wtfpl', url: 'https:///wtfpl.net'})
// => {name: 'wtfpl', url: 'https:///wtfpl.net'}
 
normalize('https://custom-license.com')
// => {name: 'custom-license.com', url: 'https:///custom-license.com'}
 

Tests

npm install
npm test

Dependencies

  • is_js: micro check library
  • lodash.clone: The modern build of lodash’s _.clone as a module.
  • oss-license-name-to-url: Convert shorthand OSS license names to opensource.org URLs
  • schemeless: Remove the parts of URLs that humans don't really need to see

Dev Dependencies

License

MIT

Generated by package-json-to-readme

Readme

Keywords

Package Sidebar

Install

npm i normalize-license-data

Weekly Downloads

2

Version

1.0.1

License

MIT

Last publish

Collaborators

  • zeke