@pobedit/package-name-parser

1.0.0 • Public • Published

@pobedit/package-name-parser

Build Status License

A package name parser.

Installation

Install with npm or Yarn:

npm:

npm install @pobedit/package-name-parser --save

Yarn:

yarn add @pobedit/package-name

Basic usage

import {parse} from '@pobedit/package-name-parser';

try {
    const {scope, name, version} = parse('@foo/bar@0.0.1');

    console.log(scope, name, version);
    /*
    {
        scope: 'foo',
        name: 'bar',
        version: '0.0.1'
    }
    */
}
catch ({message}) {
    console.error(message);
}

scope and version are optional:

parse('foo');
parse('@foo/bar');
parse('@foo/bar@0.0.1');

Contributing

Feel free to submit a pull request if you find any bugs. Please make sure all commits are properly documented.

Tests

npm test

Publishing

npm publish --access public --verbose

License

MIT

Package Sidebar

Install

npm i @pobedit/package-name-parser

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

50.8 kB

Total Files

21

Last publish

Collaborators

  • monolithed