This is a
playground to test code. It runs a full
Node.js environment and already has all of
npm’s 1,000,000+ packages pre-installed, including
touch with all
npm packages installed. Try it out:
This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.
For all your node touching needs.
npm install touch
This package exports a binary called
nodetouch that works mostly
like the unix builtin
var touch = require("touch")
Gives you the following functions:
touch(filename, options, cb)
touch.ftouch(fd, options, cb)
options objects are optional.
All the async functions return a Promise. If a callback function is provided, then it's attached to the Promise.
touch -t <date>Can be a Date object, or any parseable Date string, or epoch ms number.
touch -aCan be either a Boolean, or a Date.
touch -mCan be either a Boolean, or a Date.
touch -r <file>Must be path to a file.
mtime are set, then both values are set. If
one of them is set, then the other is not.
This package creates a
nodetouch command line executable that works
very much like the unix builtin