@james.talmage/npm-safe-name

0.0.0 • Public • Published

npm-safe-name Build Status

Check if a string you want is a safe npm name.

It checks the following rules:

  • The name must be shorter than 214 characters. This includes the scope for scoped packages.
  • The name can't start with a dot or an underscore.
  • New packages must not have uppercase letters in the name.
  • The name ends up being part of a URL, an argument on the command line, and a folder name. Therefore, the name can't contain any non-URL-safe characters.

Install

$ npm install --save npm-safe-name

Usage

var isSafe = require('npm-safe-name');

isSafe('unicorns');
//=> true

isSafe('foo bar');
//=> false

API

npmSafeName(input)

input

Required
Type: string

the name you want to check

License

MIT © James Talmage

Readme

Keywords

none

Package Sidebar

Install

npm i @james.talmage/npm-safe-name

Weekly Downloads

1

Version

0.0.0

License

MIT

Last publish

Collaborators

  • jamestalmage