Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bower-name

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bower-name - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

39

cli.js
#!/usr/bin/env node
'use strict';
var logSymbols = require('log-symbols');
var pkg = require('./package.json');
var meow = require('meow');
var bowerName = require('./');
var argv = process.argv.slice(2);
var input = argv[0];
function help() {
console.log([
var cli = meow({
help: [
'Usage',
' $ bower-name <name>',
'',
' ' + pkg.description,
'Examples',
' $ bower-name multiline',
' ' + logSymbols.error + ' Unavailable',
' $ bower-name unicorn-cake',
' ' + logSymbols.success + ' Available',
'',
' Usage',
' bower-name <name>',
'',
' Exits with code 0 when the name is available or 2 when taken'
].join('\n'));
}
'Exits with code 0 when the name is available or 2 when taken'
]
});
if (!input || argv.indexOf('--help') !== -1) {
help();
return;
if (cli.input.length === 0) {
console.error('Package name required');
process.exit(1);
}
if (argv.indexOf('--version') !== -1) {
console.log(pkg.version);
return;
}
bowerName(input, function (err, available) {
bowerName(cli.input[0], function (err, available) {
if (err) {
console.error(err);
process.exit(1);
return;
}

@@ -37,0 +32,0 @@

@@ -6,3 +6,7 @@ 'use strict';

module.exports = function (name, cb) {
got.head(endpoint + encodeURIComponent(name.toLowerCase()), function (err, data) {
if (!(typeof name === 'string' && name.length !== 0)) {
throw new Error('Package name required');
}
got.head(endpoint + encodeURIComponent(name.toLowerCase()), function (err) {
if (err && err.code === 404) {

@@ -9,0 +13,0 @@ cb(null, true);

{
"name": "bower-name",
"version": "1.0.3",
"version": "1.0.4",
"description": "Check whether a package name is available on bower",

@@ -26,3 +26,2 @@ "license": "MIT",

"cli",
"bin",
"app",

@@ -37,3 +36,4 @@ "bower",

"got": "^3.2.0",
"log-symbols": "^1.0.0"
"log-symbols": "^1.0.0",
"meow": "^3.3.0"
},

@@ -40,0 +40,0 @@ "devDependencies": {

@@ -8,3 +8,3 @@ # bower-name [![Build Status](https://travis-ci.org/sindresorhus/bower-name.svg?branch=master)](https://travis-ci.org/sindresorhus/bower-name)

```sh
```
$ npm install --save bower-name

@@ -28,3 +28,3 @@ ```

```sh
```
$ npm install --global bower-name

@@ -37,4 +37,10 @@ ```

Usage
bower-name <name>
$ bower-name <name>
Examples
$ bower-name multiline
✖ Unavailable
$ bower-name unicorn-cake
✔ Available
Exits with code 0 when the name is available or 2 when taken

@@ -41,0 +47,0 @@ ```

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