Node

The Node filter provides a number of convenience methods and variables which make writing Node scripts feel more like traditional Ruby.

List of Transformations

  • `command` child_process.execSync("command", {encoding: "utf8"})
  • ARGV process.argv.slice(2)
  • __dir__ __dirname
  • Dir.chdir process.chdir
  • Dir.entries fs.readdirSync
  • Dir.home os.homedir()
  • Dir.mkdir fs.mkdirSync
  • Dir.mktmpdir fs.mkdtempSync
  • Dir.pwd process.cwd
  • Dir.rmdir fs.rmdirSync
  • Dir.tmpdir os.tmpdir()
  • ENV process.env
  • __FILE__ __filename
  • File.absolute_path path.resolve
  • File.absolute_path? path.isAbsolute
  • File.basename path.basename
  • File.chmod fs.chmodSync
  • File.chown fs.chownSync
  • File.cp fs.copyFileSync
  • File.dirname path.dirname
  • File.exist? fs.existsSync
  • File.extname path.extname
  • File.join path.join
  • File.lchmod fs.lchmodSync
  • File.link fs.linkSync
  • File.ln fs.linkSync
  • File.lstat fs.lstatSync
  • File::PATH_SEPARATOR path.delimiter
  • File.read fs.readFileSync
  • File.readlink fs.readlinkSync
  • File.realpath fs.realpathSync
  • File.rename fs.renameSync
  • File::SEPARATOR path.sep
  • File.stat fs.statSync
  • File.symlink fs.symlinkSync
  • File.truncate fs.truncateSync
  • File.unlink fs.unlinkSync
  • FileUtils.cd process.chdir
  • FileUtils.cp fs.copyFileSync
  • FileUtils.ln fs.linkSync
  • FileUtils.ln_s fs.symlinkSync
  • FileUtils.mkdir fs.mkdirSync
  • FileUtils.mv fs.renameSync
  • FileUtils.pwd process.cwd
  • FileUtils.rm fs.unlinkSync
  • IO.read fs.readFileSync
  • IO.write fs.writeFileSync
  • system child_process.execSync(..., {stdio: "inherit"})

Next: Nokogiri