New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

normalize-pkg

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

normalize-pkg

Normalize values in package.json to improve compatibility, programmatic readability and usefulness with third party libs.

  • 0.0.9
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

normalize-pkg NPM version

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 specified destination.

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:

  • MIT
  • Apache
  • GPL, 2 and 3

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.

Authors

Jon Schlinkert

License

Copyright (c) 2014 Jon Schlinkert, contributors. Released under the MIT license


This file was generated by verb-cli on March 26, 2014.

Keywords

FAQs

Package last updated on 27 Mar 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc