# Filesystem [![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url] [![dependencies][dependencies-image]][dependencies-url] > Standard library for interfacing with a filesystem.
## Installation ```bash npm install @stdlib/fs ```
## Usage ```javascript var fs = require( '@stdlib/fs' ); ``` #### fs Standard library for interfacing with a filesystem. ```javascript var f = fs; // returns {...} ```
- [`close( fd, clbk )`][@stdlib/fs/close]: close a file descriptor. - [`exists( path, clbk )`][@stdlib/fs/exists]: test whether a path exists on the filesystem. - [`open( path[, flags[, mode]], clbk )`][@stdlib/fs/open]: open a file. - [`readDir( path, clbk )`][@stdlib/fs/read-dir]: read the contents of a directory. - [`readFileList( filepaths[, options], clbk )`][@stdlib/fs/read-file-list]: read the entire contents of each file in a file list. - [`readFile( file[, options], clbk )`][@stdlib/fs/read-file]: read the entire contents of a file. - [`readJSON( file[, options], clbk )`][@stdlib/fs/read-json]: read a file as JSON. - [`readWASM( file[, options], clbk )`][@stdlib/fs/read-wasm]: read a file as WebAssembly. - [`rename( oldPath, newPath, clbk )`][@stdlib/fs/rename]: rename a file. - [`resolveParentPathBy( path[, options], predicate, clbk )`][@stdlib/fs/resolve-parent-path-by]: resolve a path according to a predicate function by walking parent directories. - [`resolveParentPath( path[, options], clbk )`][@stdlib/fs/resolve-parent-path]: resolve a path by walking parent directories. - [`unlink( path, clbk )`][@stdlib/fs/unlink]: remove a directory entry. - [`writeFile( file, data[, options], clbk )`][@stdlib/fs/write-file]: write data to a file.
## Examples ```javascript var objectKeys = require( '@stdlib/utils/keys' ); var fs = require( '@stdlib/fs' ); console.log( objectKeys( fs ) ); ```
* * * ## Notice This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib]. #### Community [![Chat][chat-image]][chat-url] --- ## License See [LICENSE][stdlib-license]. ## Copyright Copyright © 2016-2021. The Stdlib [Authors][stdlib-authors].