@hexlet/fs

0.4.1 • Public • Published

js-fs

github action status

Install

npm install @hexlet/fs

Usage example

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

Hexlet Ltd. logo

This repository is created and maintained by the team and the community of Hexlet, an educational project. Read more about Hexlet (in Russian).

Readme

Keywords

none

Package Sidebar

Install

npm i @hexlet/fs

Weekly Downloads

2

Version

0.4.1

License

ISC

Unpacked Size

22.7 kB

Total Files

16

Last publish

Collaborators

  • dzencot
  • grozwalker
  • mshkv
  • mokevnin
  • corsicanec82