Skip to content

Instantly share code, notes, and snippets.

@phra
Created May 29, 2018 20:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save phra/51f73898df729789aff741c6ea91d294 to your computer and use it in GitHub Desktop.
Save phra/51f73898df729789aff741c6ea91d294 to your computer and use it in GitHub Desktop.
read /etc/passwd without `fs` Node.js module
const buffer = Buffer.allocUnsafe(8192)
process.binding('fs').read(process.binding('fs').open('/etc/passwd', 0, 0600), buffer, 0, 4096)
console.log(buffer.toString())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment