Socket
Socket
Sign inDemoInstall

@iarna/cli

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@iarna/cli - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

12

app.js
'use strict'
const onExit = require('signal-exit')
const updateNotifier = require('update-notifier');
const yargs = require('yargs')

@@ -30,3 +29,6 @@ const path = require('path')

: Object.keys(pkg.bin).some(b => nameMatch.test(b) || nameMatch.test(pkg.bin[b]))
if (isInPackage) updateNotifier({pkg: pkg}).notify()
if (isInPackage) {
const updateNotifier = require('update-notifier');
updateNotifier({pkg: pkg}).notify()
}
} catch (ex) { /* don't care */ }

@@ -49,3 +51,7 @@ })

exited = true
console.error(err && err.stack ? err.stack : err)
if (typeof err === 'number') {
process.exit(err)
} else if (err) {
console.error(err && err.stack ? err.stack : err)
}
process.exit(1)

@@ -52,0 +58,0 @@ }

{
"name": "@iarna/cli",
"version": "1.1.0",
"version": "1.2.0",
"description": "Some simple CLI scaffolding for promise returning applications.",

@@ -5,0 +5,0 @@ "main": "app.js",

@@ -14,2 +14,3 @@ # @iarna/cli

.boolean('reject')
.boolean('code50')
.version()

@@ -24,2 +25,3 @@ .help()

if (opts.reject) return Promise.reject(new Error('reject'))
if (opts.code50) return Promise.reject(50)
return new Promise(resolve => setTimeout(resolve, 10000))

@@ -44,3 +46,2 @@ }

$ node example --silent hello there world --error
Abnormal exit: Promises not resolved
Got: hello there world

@@ -61,3 +62,6 @@ Error: throw

at processImmediate [as _immediateCallback] (timers.js:733:5)
$
$ node example --silent hello there world --code50
Got: hello there world
$ echo $?
50
```

@@ -94,6 +98,6 @@

The module itself returns a function that you need to call with the name of
your main function. This is the top level function of your program that
should return a promise, that when resolved indicates that your program is
complete.
The module itself exports a function that you need to call with the name of
your main function. Your main function is like `main` in C, it's the entry
point for your program. It needs to return a promise that resolves when
your program completes.

@@ -100,0 +104,0 @@ Your entry point function can be named anything, but it needs to return a

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