WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

ts-task/fs

Tasks File System

This library is a wrapper of async functions of Node.js fs module using @ts-task instead of Promises.

Use

Install it

npm i @ts-task/fs

Use it

import * as fs from '@ts-task/fs';


fs.readFile('./README.md')
    .fork(
        err => {
            err; // $ExpectType ErrnoException
            if (err.code === 'ENOENT') {
                console.error('Buu, the file does not exists');
            }
        },
        buffer => {
            buffer; // ExpectType Buffer
            console.log(buffer.toString());
        }
    )

You can see the API reference here.

You can see more example usages in the types test file.

About

Node.js fs module wrapper to use task instead of promises

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published