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
@hint/utils-fs 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.
Set of helpers to work with the filesystem.
This package is installed automatically when adding webhint to your project so running the following is enough:
npm install hint --save-dev
cwd: Returns the current working directory. Same as
fileExtension: Try to determine the resource's file extension.
fileName: Returns the name of a file. Same as
isDirectory: Check if a path is a directory and exists.
isFile: Check if a path is a file and exists.
loadJSONFile: Loads a JSON a file.
pathExists: Check if a path exists.
readFileAsync: Convenience wrapper for asynchronously reading file contents.
readFile: Convenience wrapper for synchronously reading file contents.
writeFileAsync: Convenience wrapper for asynchronously write a file.