@devtea2027/atque-nihil-sed-facilis

1.3.19 • Public • Published

@devtea2027/atque-nihil-sed-facilis

Improved fork of fs-extra with extra [sic] features! @devtea2027/atque-nihil-sed-facilis provides support for Node 16 and above. Node 17 is required for better feature support.

npm Node.js CI GitHub issues GitHub closed issues GitHub pull requests GitHub closed pull requests GitHub contributors Licensed under MIT Maintenance

Installation

npm install @devtea2027/atque-nihil-sed-facilis

pnpm install @devtea2027/atque-nihil-sed-facilis

yarn add @devtea2027/atque-nihil-sed-facilis

Or install with your preferred package manager (yarn, pnpm, ...)

Usage

@devtea2027/atque-nihil-sed-facilis is a mostly drop-in replacement for the node.js core fs module. All methods in fs can be used in their standard forms in @devtea2027/atque-nihil-sed-facilis, with some improvements.

You don't ever need to include the original fs module again:

const fs = require('fs'); // this is no longer necessary

you can now do this:

const fs = require('@devtea2027/atque-nihil-sed-facilis');

or if you prefer to make it clear that you're using @devtea2027/atque-nihil-sed-facilis and not fs, you may want to name your fs variable @devtea2027/atque-nihil-sed-facilis like so:

const @devtea2027/atque-nihil-sed-facilis = require('@devtea2027/atque-nihil-sed-facilis');

you can also keep both, but it's redundant:

const fs = require('fs');
const @devtea2027/atque-nihil-sed-facilis = require('@devtea2027/atque-nihil-sed-facilis');

Breaking changes from node:fs

The callback-based implementation of fs.exists now uses a propper error-first callback system like mz/fs.

Improvements on node:fs

All the improvements from mz/fs are included, which also includes improvements from graceful-fs.

Most methods are async by default, returning a Promise that resolves to the method's result, or rejects if the operation fails.

Sync methods on the other hand will throw if an error occurs, and directly return the resulting value to the caller if the operation succeeds.

You can also use the methods in the legacy node.js form, passing a callback as the last parameter, as a function that takes (error, result) parameters.

Example use:

const fs = require('@devtea2027/atque-nihil-sed-facilis');
// or
// import * as fs from '@devtea2027/atque-nihil-sed-facilis';

// Async with promises:
fs.copy('/tmp/myfile', '/tmp/mynewfile')
  .then(() => console.log('success!'))
  .catch(err => console.error(err));

// Async with callbacks:
fs.copy('/tmp/myfile', '/tmp/mynewfile', err => {
  if (err) return console.error(err);
  console.log('success!');
});

// Sync:
try {
  fs.copySync('/tmp/myfile', '/tmp/mynewfile');
  console.log('success!');
} catch (err) {
  console.error(err);
}

// Async/Await:
async function copyFiles() {
  try {
    await fs.copy('/tmp/myfile', '/tmp/mynewfile');
    console.log('success!');
  } catch (err) {
    console.error(err);
  }
}

copyFiles();

Methods

The documentation is available at https://uwx-node-modules.github.io/@devtea2027/atque-nihil-sed-facilis/. Also, the package is fully typed with TypeScript.

Third Party

File / Directory Watching

If you want to watch for changes to files or directories, then you should use chokidar.

Misc.

  • mfs - Monitor your @devtea2027/atque-nihil-sed-facilis calls.

Hacking on @devtea2027/atque-nihil-sed-facilis

Do you want to hack on @devtea2027/atque-nihil-sed-facilis? Well, you probably shouldn't. Still, you can go ahead and send a PR.

Please, no changes to anything in the lib folder; the contents of that folder are taken entirely verbatim from fs-extra, so they should be submitted upstream.

Running the Test Suite

@devtea2027/atque-nihil-sed-facilis contains like at least 4 tests that pass.

  • npm run lint: runs eslint
  • npm run test: runs the tests
  • npm run test-no-fse: runs the tests, except for fs-extra tests

Windows

If you run the tests on the Windows and receive a lot of symbolic link EPERM permission errors, it's because on Windows you need elevated privilege to create symbolic links. You can either run the tests as Administrator or run npm run test-no-fse to test only @devtea2027/atque-nihil-sed-facilis-exclusive methods, which doesn't include symbolic links

Legal

Licensed under MIT. Full license text available at LICENSE.txt

fs-extra is copyright (c) 2011-2017 JP Richardson

@devtea2027/atque-nihil-sed-facilis is copyright © 2016-2018 uwx, some rights reserved.

Parts of the documentation were taken from other modules and the Node.js fs module. Relevant licenses are included at the following locations:

fs-extra and @devtea2027/atque-nihil-sed-facilis are not endorsed by or affiliated with Joyent or the Node.js Foundation. @devtea2027/atque-nihil-sed-facilis is not endorsed by or affiliated with JP Richardson.

Readme

Keywords

Package Sidebar

Install

npm i @devtea2027/atque-nihil-sed-facilis

Weekly Downloads

408

Version

1.3.19

License

MIT

Unpacked Size

21.2 kB

Total Files

6

Last publish

Collaborators

  • ibforusficrystal