For all your node touching needs.
This is a fork of Isaac Schlueter's touch
module. This adds the ability to use touch from npm scripts in a cross platform manner, like so:
{
"scripts": {
"touch": "touch foo",
"remove": "rimraf foo"
}
}
npm install --save-dev https://github.com/shovon/node-touch/tarball/v0.1.0
See man touch
var touch = require("touch")
Gives you the following functions:
touch(filename, options, cb)
touch.sync(filename, options)
touch.ftouch(fd, options, cb)
touch.ftouchSync(fd, options)
force
liketouch -f
Booleantime
liketouch -t <date>
Can be a Date object, or any parseable Date string, or epoch ms number.atime
liketouch -a
Can be either a Boolean, or a Date.mtime
liketouch -m
Can be either a Boolean, or a Date.ref
liketouch -r <file>
Must be path to a file.nocreate
liketouch -c
Boolean
If neither atime
nor mtime
are set, then both values are set. If
one of them is set, then the other is not.