You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 1.2KB

4 lat temu
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. # node-touch
  2. For all your node touching needs.
  3. ## Installing
  4. ```bash
  5. npm install touch
  6. ```
  7. ## CLI Usage:
  8. See `man touch`
  9. This package exports a binary called `nodetouch` that works mostly
  10. like the unix builtin `touch(1)`.
  11. ## API Usage:
  12. ```javascript
  13. var touch = require("touch")
  14. ```
  15. Gives you the following functions:
  16. * `touch(filename, options, cb)`
  17. * `touch.sync(filename, options)`
  18. * `touch.ftouch(fd, options, cb)`
  19. * `touch.ftouchSync(fd, options)`
  20. All the `options` objects are optional.
  21. All the async functions return a Promise. If a callback function is
  22. provided, then it's attached to the Promise.
  23. ## Options
  24. * `force` like `touch -f` Boolean
  25. * `time` like `touch -t <date>` Can be a Date object, or any parseable
  26. Date string, or epoch ms number.
  27. * `atime` like `touch -a` Can be either a Boolean, or a Date.
  28. * `mtime` like `touch -m` Can be either a Boolean, or a Date.
  29. * `ref` like `touch -r <file>` Must be path to a file.
  30. * `nocreate` like `touch -c` Boolean
  31. If neither `atime` nor `mtime` are set, then both values are set. If
  32. one of them is set, then the other is not.
  33. ## cli
  34. This package creates a `nodetouch` command line executable that works
  35. very much like the unix builtin `touch(1)`