Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@antongolub
Copy link
Collaborator

continues #811
relates #764

const p = $`echo 'foo\nbar'`

await p.text()        // foo\n\bar\n
await p.text('hex')   //  666f6f0a0861720a
await p.buffer()      //  Buffer.from('foo\n\bar\n')
await p.lines()       // ['foo', 'bar']
await $`echo '{"foo": "bar"}'`.json() // {foo: 'bar'}
  • Tests pass

@antonmedv
Copy link
Collaborator

Hmmm, im not sure we need those. Let’s keep API surface smaller?

: this.buffer().toString(encoding)
}

lines() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just .text().split ()?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants