# filesystem-constants

> Inlined FS constants without the FS module dependency.

Latest version **1.0.0** (published 2019-04-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install filesystem-constants
pnpm add filesystem-constants
yarn add filesystem-constants
bun add filesystem-constants
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2019-04-09 |
| First published | 2019-04-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Andrew Osheroff |
| Maintainers | andrewosh |
| Keywords | hyperdrive, constants |

## Links

- npm: https://www.npmjs.com/package/filesystem-constants
- Repository: https://github.com/andrewosh/filesystem-constants
- Homepage: https://github.com/andrewosh/filesystem-constants#readme
- Issues: https://github.com/andrewosh/filesystem-constants/issues
- npm.io page: https://npm.io/package/filesystem-constants

## Recent versions

- 1.0.0 (latest) — 2019-04-09

## README

# 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.

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

### `constants.translate(from, to, flags)`
Translates flags between two platform-specific representations.

```js
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

---
_Source: https://npm.io/package/filesystem-constants · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
