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

coffee

Package Overview
Dependencies
Maintainers
4
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

coffee - npm Package Compare versions

Comparing version 5.3.0 to 5.4.0

6

HISTORY.md
5.4.0 / 2020-04-28
==================
**features**
* [[`62c2d11`](http://github.com/node-modules/coffee/commit/62c2d1104af9944ae1c05ca1b4280c3f21ff222e)] - feat: pass instance to event (#81) (TZ | 天猪 <<atian25@qq.com>>)
5.3.0 / 2020-04-22

@@ -3,0 +9,0 @@ ==================

7

lib/coffee.js

@@ -61,3 +61,3 @@ 'use strict';

this.stdout += buf;
this.emit('stdout', buf.toString());
this.emit('stdout', buf.toString(), this);
});

@@ -68,3 +68,3 @@ this.on('stderr_data', buf => {

this.stderr += buf;
this.emit('stderr', buf.toString());
this.emit('stderr', buf.toString(), this);
});

@@ -297,5 +297,2 @@ this.on('error', err => {

}
} else {
// end stdin anyway
cmd.stdin.end();
}

@@ -302,0 +299,0 @@

{
"name": "coffee",
"version": "5.3.0",
"version": "5.4.0",
"description": "Test command line on Node.js.",

@@ -46,3 +46,4 @@ "main": "index.js",

"ci": {
"version": "6, 8, 10, 12"
"version": "6, 8, 10, 12",
"type": "travis, github"
},

@@ -49,0 +50,0 @@ "scripts": {

@@ -246,4 +246,6 @@ # Coffee

cli process should emit `prompt` message:
**cli process should emit `prompt` message:**
> Or use `coffee.on('stdout', callback)` instead, see docs below.
```js

@@ -289,7 +291,10 @@ const readline = require('readline');

use for kill long-run process:
```js
coffee.fork('path/to/cli')
.on('stdout', function (buf) {
if (buf.toString().includes('egg-ready')) {
this.proc.kill();
.on('stdout', (buf, { proc }) => {
if (buf.includes('egg-ready')) {
proc.exitCode = 0;
proc.kill();
}

@@ -301,2 +306,16 @@ })

use for prompt:
```js
// do not call `waitForPrompt` / `write` / `writeKey`
coffee.fork('path/to/cli')
.on('stdout', (buf, { proc }) => {
if (buf.includes('Your Name: ')) {
proc.stdin.write('TZ\n');
}
})
.expect('stdout', 'Your Name: TZ\n')
.end(done);
```
#### coffee.debug(level)

@@ -303,0 +322,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