Skip to content

Don't override fs module #89

@ikokostya

Description

@ikokostya

Problem

Now node-fs-ext overrides fs module, i.e. adds new constants to it. Because Node.js modules are cached, other modules got implicitly redefined fs module.

Also, since Node.js 11 constants are not extensible anymore #76 and deprecated since Node.js 6. So, there is no way to get them in new versions of Node.js (only import binding file directly).

Proposal

Instead node-fs-ext can export own constants and doesn't touch core fs module:

const {fcntl, constants} = require('fs-ext');

fs.fcntl(fd, constants.F_SETLK, constants.F_WRLCK, (err) => { ... }); 

Related Issues

#81

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions