Merge pull request #10 from seald/jsdoc-detail

jsdoc details + timeout
pull/12/head
tex0l 3 years ago committed by GitHub
commit 5bba11e535
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 21
      lib/datastore.js
  2. 1
      test/persistence.test.js

@ -11,16 +11,17 @@ const { isDate } = require('./utils.js')
class Datastore extends EventEmitter { class Datastore extends EventEmitter {
/** /**
* Create a new collection * Create a new collection
* @param {String} options.filename Optional, datastore will be in-memory only if not provided * @param {String} [options.filename] Optional, datastore will be in-memory only if not provided
* @param {Boolean} options.timestampData Optional, defaults to false. If set to true, createdAt and updatedAt will be created and populated automatically (if not specified by user) * @param {Boolean} [options.timestampData] Optional, defaults to false. If set to true, createdAt and updatedAt will be created and populated automatically (if not specified by user)
* @param {Boolean} options.inMemoryOnly Optional, defaults to false * @param {Boolean} [options.inMemoryOnly] Optional, defaults to false
* @param {String} options.nodeWebkitAppName Optional, specify the name of your NW app if you want options.filename to be relative to the directory where * @param {String} [options.nodeWebkitAppName] Optional, specify the name of your NW app if you want options.filename to be relative to the directory where
* Node Webkit stores application data such as cookies and local storage (the best place to store data in my opinion) * Node Webkit stores application data such as cookies and local storage (the best place to store data in my opinion)
* @param {Boolean} options.autoload Optional, defaults to false * @param {Boolean} [options.autoload] Optional, defaults to false
* @param {Function} options.onload Optional, if autoload is used this will be called after the load database with the error object as parameter. If you don't pass it the error will be thrown * @param {Function} [options.onload] Optional, if autoload is used this will be called after the load database with the error object as parameter. If you don't pass it the error will be thrown
* @param {Function} options.afterSerialization/options.beforeDeserialization Optional, serialization hooks * @param {Function} [options.beforeDeserialization] Optional, serialization hooks
* @param {Number} options.corruptAlertThreshold Optional, threshold after which an alert is thrown if too much data is corrupt * @param {Function} [options.afterSerialization] Optional, serialization hooks
* @param {Function} options.compareStrings Optional, string comparison function that overrides default for sorting * @param {Number} [options.corruptAlertThreshold] Optional, threshold after which an alert is thrown if too much data is corrupt
* @param {Function} [options.compareStrings] Optional, string comparison function that overrides default for sorting
* *
* Event Emitter - Events * Event Emitter - Events
* * compaction.done - Fired whenever a compaction operation was finished * * compaction.done - Fired whenever a compaction operation was finished

@ -1037,6 +1037,7 @@ describe('Persistence', function () {
// Not run on Windows as there is no clean way to set maximum file descriptors. Not an issue as the code itself is tested. // Not run on Windows as there is no clean way to set maximum file descriptors. Not an issue as the code itself is tested.
it('Cannot cause EMFILE errors by opening too many file descriptors', function (done) { it('Cannot cause EMFILE errors by opening too many file descriptors', function (done) {
this.timeout(5000)
if (process.platform === 'win32' || process.platform === 'win64') { return done() } if (process.platform === 'win32' || process.platform === 'win64') { return done() }
execFile('test_lac/openFdsLaunch.sh', function (err, stdout, stderr) { execFile('test_lac/openFdsLaunch.sh', function (err, stdout, stderr) {
if (err) { return done(err) } if (err) { return done(err) }

Loading…
Cancel
Save