source: node_modules/touch/README.md

main
Last change on this file was 81bc7da, checked in by Klimentina Efremova <klimentina08642@…>, 3 months ago

Initial commit

  • Property mode set to 100644
File size: 1.2 KB
RevLine 
[81bc7da]1# node-touch
2
3For all your node touching needs.
4
5## Installing
6
7```bash
8npm install touch
9```
10
11## CLI Usage:
12
13See `man touch`
14
15This package exports a binary called `nodetouch` that works mostly
16like the unix builtin `touch(1)`.
17
18## API Usage:
19
20```javascript
21var touch = require("touch")
22```
23
24Gives you the following functions:
25
26* `touch(filename, options, cb)`
27* `touch.sync(filename, options)`
28* `touch.ftouch(fd, options, cb)`
29* `touch.ftouchSync(fd, options)`
30
31All the `options` objects are optional.
32
33All the async functions return a Promise. If a callback function is
34provided, then it's attached to the Promise.
35
36## Options
37
38* `force` like `touch -f` Boolean
39* `time` like `touch -t <date>` Can be a Date object, or any parseable
40 Date string, or epoch ms number.
41* `atime` like `touch -a` Can be either a Boolean, or a Date.
42* `mtime` like `touch -m` Can be either a Boolean, or a Date.
43* `ref` like `touch -r <file>` Must be path to a file.
44* `nocreate` like `touch -c` Boolean
45
46If neither `atime` nor `mtime` are set, then both values are set. If
47one of them is set, then the other is not.
48
49## cli
50
51This package creates a `nodetouch` command line executable that works
52very much like the unix builtin `touch(1)`
Note: See TracBrowser for help on using the repository browser.