0.1.0 • Published 6 years ago
unsed v0.1.0
= unsed
An implementation of a subset of the sed
command-line program.
== Subset
Currently provides d
, s
and a
== Install
npm install unsed --save
const sed = require('unsed').sed;
orimport {sed} from 'unsed';
== Examples
sed('1\n2\n3').command('2d').execute() === '1\n3';
sed('1\n2\n3\n4\n').command('2,3!d').execute() === '2\n3\n';
sed('1b\n2a\n').command('s/a/b/').execute() === '1b\n2b\n';
sed('1b\n2a\n3a\n4b\n').command('/a/d').command('s/4(b)/5\\1/).execute() === '1b\n5b\n';
sed('a\nb\nd\n').command('2a\nc').execute() === 'a\nb\nc\nd\n';
== Run the tests
npm run test