Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/feross/available
Scan npm for available package names
https://github.com/feross/available
available javascript name nodejs npm package package-manager registry
Last synced: 18 days ago
JSON representation
Scan npm for available package names
- Host: GitHub
- URL: https://github.com/feross/available
- Owner: feross
- License: mit
- Created: 2015-07-22T17:54:51.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2020-10-27T22:12:55.000Z (about 4 years ago)
- Last Synced: 2024-09-17T09:33:33.457Z (about 2 months ago)
- Topics: available, javascript, name, nodejs, npm, package, package-manager, registry
- Language: JavaScript
- Homepage:
- Size: 68.4 KB
- Stars: 100
- Watchers: 5
- Forks: 10
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# available [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]
[travis-image]: https://img.shields.io/travis/feross/available/master.svg
[travis-url]: https://travis-ci.org/feross/available
[npm-image]: https://img.shields.io/npm/v/available.svg
[npm-url]: https://npmjs.org/package/available
[downloads-image]: https://img.shields.io/npm/dm/available.svg
[downloads-url]: https://npmjs.org/package/available
[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg
[standard-url]: https://standardjs.com### Scan npm for available package names
## install
```
npm install available -g
```## usage
### cli
Get available names from the npm registry:
```bash
$ available
your
was
our
...
```Full options list:
```
Usage:
available [optional-name]Scan npm for available package names.
Examples:
Print lots of possible names:
available
available --offlineCheck for a certain name:
available my-cool-name
available my-cool-name --related
available my-cool-name --offlineFlags:
-r, --related Search for related module names (Uses thesaurus)
-o, --offline Force offline mode (Does not verify names are actually available)
-v, --version Show current version
-h, --help Show usage information
```### api
#### `available.getNames(opts, next)`
Get available package names from npm.
If `opts.online` is `true`, verify that the
names are actually available. Otherwise, a local
[package name database](https://npmjs.com/package/all-the-package-names) is used,
which may be slightly out-of-date.`next(err, name)` is called each time an available package is found. This allows
for "streaming" the possible names from the registry. If `err` is an `Error`, then
there was a problem and `next` will not be called again. `name` is the available
package name.#### `available.checkName(name, opts, next)`
Check if a specific `name` is available on npm.
If `opts.online` is `true`, verify that the
names are actually available. Otherwise, a local
[package name database](https://npmjs.com/package/all-the-package-names) is used,
which may be slightly out-of-date.If `opts.related` is `true`, then this will search for related module names using
a thesaurus.`next(err, name)` is called each time an available package is found. This allows
for "streaming" the possible names from the registry. If `err` is an `Error`, then
there was a problem and `next` will not be called again. `name` is the available
package name.## license
MIT. Copyright (c) [Feross Aboukhadijeh](http://feross.org).