Skip to content

Instantly share code, notes, and snippets.

@isaacs
Created December 9, 2010 04:40
Show Gist options
  • Save isaacs/734345 to your computer and use it in GitHub Desktop.
Save isaacs/734345 to your computer and use it in GitHub Desktop.
Someone build this for me, ok?
// find some-dir ... \
// | egrep 'o+$' \
// | sed -e 's|^foo|bar|' -e 's|^bar$|baz|g'
find("some-dir", {type:"file", older:new Date("January 12, 2010")})
.pipe(grep(/o+$/))
.pipe(sed([/^foo/, "bar"], [/^bar$/g, "baz"]))
.pipe(cat())
@ry
Copy link

ry commented Dec 9, 2010

maybe:

 require('bin').find("some-dir", {type:"file", older:new Date("January 12, 2010")})
   .grep(/o+$/)
   .sed([/^foo/, "bar"], [/^bar$/g, "baz"])
   .pipe(process.stdout)

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