Socket
Socket
Sign inDemoInstall

bundle-name

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bundle-name - npm Package Compare versions

Comparing version 0.1.1 to 1.0.0

30

cli.js
#!/usr/bin/env node
'use strict';
var bundleName = require('./index');
var input = process.argv[2];
var pkg = require('./package.json');
var bundleName = require('./');
var argv = process.argv.slice(2);
var input = argv[0];
if (!input || process.argv.indexOf('-h') !== -1 || process.argv.indexOf('--help') !== -1) {
return console.log('Usage\n bundle-name <bundle id>\n\nExample\n bundle-name com.apple.Safari\n #=> Safari\n\nReturns the bundle name from a bundle identifier');
function help() {
console.log([
'',
' ' + pkg.description,
'',
' Usage',
' bundle-name <bundle-id>',
'',
' Example',
' bundle-name com.apple.Safari',
' Safari'
].join('\n'));
}
if (process.argv.indexOf('-v') !== -1 || process.argv.indexOf('--version') !== -1) {
return console.log(require('./package').version);
if (argv.indexOf('--help') !== -1) {
help();
return;
}
if (argv.indexOf('--version') !== -1) {
console.log(pkg.version);
return;
}
bundleName(input, function (err, name) {

@@ -15,0 +33,0 @@ if (err) {

2

package.json
{
"name": "bundle-name",
"version": "0.1.1",
"version": "1.0.0",
"description": "Get bundle name from a bundle identifier (OS X): com.apple.Safari => Safari",

@@ -5,0 +5,0 @@ "license": "MIT",

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

```sh
$ npm install --save bundle-name
```
npm install --save bundle-name
```
## Example
## Usage

@@ -19,4 +19,6 @@ ```js

bundleName('com.apple.Safari');
//=> Safari
bundleName('com.apple.Safari', function (err, name) {
console.log(name);
//=> Safari
});
```

@@ -27,19 +29,25 @@

You can also use it as a CLI app by installing it globally:
```sh
$ npm install --global bundle-name
```
npm install --global bundle-name
```
### Usage
```sh
$ bundle-name --help
Usage
bundle-name <bundle-id>
Example
bundle-name com.apple.Safari
Safari
```
bundle-name com.apple.Safari
```
Which will output `Safari`.
## Related
See [bundle-id](https://github.com/sindresorhus/bundle-id) for the inverse.
## License
MIT © [Sindre Sorhus](http://sindresorhus.com)
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