Socket
Socket
Sign inDemoInstall

help-me

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

help-me - npm Package Compare versions

Comparing version 4.1.0 to 4.2.0

13

help-me.js
'use strict'
const fs = require('fs')
const { PassThrough, pipeline } = require('readable-stream')
const { PassThrough, Writable, pipeline } = require('stream')
const glob = require('glob')
const process = require('process')

@@ -21,2 +22,10 @@ const defaults = {

function createDefaultStream () {
return new Writable({
write (chunk, encoding, callback) {
process.stdout.write(chunk, callback)
}
})
}
function helpMe (opts) {

@@ -98,3 +107,3 @@ opts = Object.assign({}, defaults, opts)

opts = opts || {}
const stream = opts.stream || process.stdout
const stream = opts.stream || createDefaultStream()
const _onMissingHelp = opts.onMissingHelp || onMissingHelp

@@ -101,0 +110,0 @@ return new Promise((resolve, reject) => {

3

package.json
{
"name": "help-me",
"version": "4.1.0",
"version": "4.2.0",
"description": "Help command for node, partner of minimist and commist",

@@ -29,2 +29,3 @@ "main": "help-me.js",

"pre-commit": "^1.1.3",
"proxyquire": "^2.1.3",
"standard": "^16.0.0",

@@ -31,0 +32,0 @@ "tap-spec": "^5.0.0",

@@ -6,4 +6,6 @@ 'use strict'

const fs = require('fs')
const os = require('os')
const path = require('path')
const helpMe = require('./')
const proxyquire = require('proxyquire')

@@ -321,1 +323,28 @@ test('throws if no directory is passed', function (t) {

})
test('should allow for awaiting the response with default stdout stream', async function (t) {
t.plan(2)
const _process = Object.create(process)
const stdout = Object.create(process.stdout)
Object.defineProperty(_process, 'stdout', {
value: stdout
})
let completed = false
stdout.write = (data, cb) => {
t.equal(data.toString(), 'hello world' + os.EOL)
completed = true
cb()
}
const helpMe = proxyquire('./help-me', {
process: _process
})
await helpMe.help({
dir: 'fixture/basic'
})
t.ok(completed)
})
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