Socket
Socket
Sign inDemoInstall

filesystem-constants

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    filesystem-constants

Inlined FS constants without the FS module dependency.


Version published
Weekly downloads
7
decreased by-61.11%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

filesystem-constants

Inlined FS constants without the dependency on Node's FS module.

Also provides a few utility functions for converting fs.open flags between OSX and Linux, and for converting between string and integer representations.

Installation

npm i filesystem-constants --save

Usage

constants.linux

FS constants on Linux, copied from fs.constants.

constants.darwin

FS constants on OSX, copied from fs.constants.

constants.parse

Converts flags from their string representation (i.e. 'r') to a flags integer.

const { linux, parse } = require('filesystem-constants')
const flags = parse(linux, 'w+') // 578

constants.translate(from, to, flags)

Translates flags between two platform-specific representations.

const { linux, darwin, translate } = require('filesystem-constants')
translate(darwin, linux, darwin.O_CREATE | darwin.O_APPEND) // 1088 (linux.O_CREATE | linux.O_APPEND)

License

MIT

Keywords

FAQs

Last updated on 09 Apr 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc