1.2.0 • Published 9 days ago

fortune-fs v1.2.0

Weekly downloads
2
License
MIT
Repository
github
Last release
9 days ago

Fortune File System Adapter

GitHub Actions Workflow Status npm Version License

This is a file system adapter for Fortune.js.

$ npm install fortune-fs --save

Usage

const path = require('path')
const fortune = require('fortune')
const fsAdapter = require('fortune-fs')

const store = fortune(recordTypes, {
  adapter: [ fsAdapter, {
    // Absolute path to database directory.
    path: path.join(__dirname, 'db')
  } ]
})

Options

OptionDefault
concurrentReads128limits how many files can be read concurrently by Adapter.find()

Options Example

const path = require('path')
const fortune = require('fortune')
const fsAdapter = require('fortune-fs')

const store = fortune(recordTypes, {
  adapter: [ fsAdapter, {
    // Absolute path to database directory.
    path: path.join(__dirname, 'db'),
    concurrentReads: 32
  } ]
})

Troubleshooting

If you have a large number of records (files), you may encounter Error: EMFILE: too many open files. Set the concurrentReads option to a lower value to resolve this.

License

This software is licensed under the MIT license.

1.2.0

9 days ago

1.1.0

5 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago