touch
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|---|---|---|---|---|
nopt | 1.0.10 | 10 kB | MIT | prod |
The "touch" is a popular npm package that simulates the Unix built-in function touch(1)
. Its primary functionality is to modify file timestamps. It provides both synchronous and asynchronous modes, with promise support for the asynchronous functions. Furthermore, touch supports numerous options, providing flexibility for usage.
To use "touch" in your project, you first need to install it using the npm install touch
command. After successful installation, you can require it in your JavaScript code like this: var touch = require("touch")
.
Here are some usage examples:
var touch = require("touch")
touch("file.txt", options, function(err) {
// Handle errors if necessary
})
var touch = require("touch")
touch.sync("file.txt", options)
Replace "file.txt" with the name of the file you wish to touch and options
with an optional object containing configuration properties. If you provide a callback function with asynchronous mode, it will be attached to the Promise.
The documentation for the "touch" npm package can be found in the readme file of the GitHub repository node-touch. It provides detailed explanations of the API usage, options you can use, and how to use the CLI (Command Line Interface) tool "nodetouch" that comes with the package.