https://github.com/hexlet-components/js-fs
https://github.com/hexlet-components/js-fs
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/hexlet-components/js-fs
- Owner: hexlet-components
- Created: 2016-07-01T08:23:54.000Z (almost 10 years ago)
- Default Branch: main
- Last Pushed: 2024-09-05T07:31:00.000Z (almost 2 years ago)
- Last Synced: 2025-08-08T17:24:40.485Z (11 months ago)
- Language: JavaScript
- Size: 1.42 MB
- Stars: 1
- Watchers: 8
- Forks: 3
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# js-fs
[](https://github.com/hexlet-components/js-fs/actions)
## Install
```sh
npm install @hexlet/fs
```
## Usage example
```javascript
import HexletFs from '@hexlet/fs';
const fs = new HexletFs();
fs.mkdirSync('/opt');
fs.mkdirpSync('/etc/nginx/conf.d');
fs.rmdirSync('/opt');
fs.touchSync('/etc/nginx/nginx.conf');
fs.touchSync('/etc/hosts');
fs.unlinkSync('/etc/nginx/nginx.conf');
fs.readdirSync('/etc'); // ['nginx', 'hosts']
fs.statSync('/etc/hosts').isFile(); // true
fs.statSync('/etc/hosts').isDirectory(); // false
fs.statSync('/etc').isDirectory(); // true
fs.writeFileSync('/etc/hosts', 'localhost');
fs.readFileSync('/etc/hosts'); // 'localhost'
fs.copySync('/etc/hosts', '/etc/nginx');
fs.readdirSync('/etc/nginx'); // [ 'conf.d', 'hosts' ]
```
For more information, see the [Full Documentation](https://github.com/hexlet-components/js-fs/tree/master/docs)
---
[](https://hexlet.io?utm_source=github&utm_medium=link&utm_campaign=js-fs)
This repository is created and maintained by the team and the community of Hexlet, an educational project. [Read more about Hexlet](https://hexlet.io?utm_source=github&utm_medium=link&utm_campaign=js-fs).
See most active contributors on [hexlet-friends](https://friends.hexlet.io/).