Last commit july 5th

This commit is contained in:
2024-07-05 13:46:23 +02:00
parent dad0d86e8c
commit b0e4dfbb76
24982 changed files with 2621219 additions and 413 deletions

9
spa/node_modules/with-open-file/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,9 @@
MIT License
Copyright (c) Raphael von der Grün <raphinesse@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

51
spa/node_modules/with-open-file/README.md generated vendored Normal file
View File

@@ -0,0 +1,51 @@
# with-open-file [![Build Status](https://travis-ci.org/raphinesse/with-open-file.svg?branch=master)](https://travis-ci.org/raphinesse/with-open-file)
> Do stuff with an open file, knowing it will finally be closed
Because the built-in way requires way too much boilerplate.
## Install
```
$ npm install with-open-file
```
## Usage
```js
const withOpenFile = require('with-open-file')
withOpenFile('foo.txt', 'r', fd => {
// Process file using fd
})
withOpenFile.sync('foo.txt', 'r', fd => {
// Process file synchronously using fd
})
```
## API
### withOpenFile(...openArgs, callback)
Returns a `Promise` wrapping the result of calling `callback` with the requested file descriptor.
### withOpenFile.sync(...openArgs, callback)
Returns the result of calling `callback` with the requested file descriptor.
#### ...openArgs
Arguments as supported by [`fs.openSync`](https://nodejs.org/api/fs.html#fs_fs_opensync_path_flags_mode)
#### callback
Type: `function`
## License
MIT © Raphael von der Grün

25
spa/node_modules/with-open-file/index.js generated vendored Normal file
View File

@@ -0,0 +1,25 @@
'use strict'
const fs = require('fs')
const pify = require('pify')
const pTry = require('p-try')
const pFinally = require('p-finally')
const fsP = pify(fs)
module.exports = (...args) => {
const callback = args.pop()
return fsP
.open(...args)
.then(fd => pFinally(pTry(callback, fd), _ => fsP.close(fd)))
}
module.exports.sync = (...args) => {
const callback = args.pop()
const fd = fs.openSync(...args)
try {
return callback(fd)
} finally {
fs.closeSync(fd)
}
}

54
spa/node_modules/with-open-file/package.json generated vendored Normal file
View File

@@ -0,0 +1,54 @@
{
"name": "with-open-file",
"version": "0.1.7",
"description": "Do stuff with an open file, knowing it will finally be closed",
"repository": "raphinesse/with-open-file",
"license": "MIT",
"author": {
"name": "Raphael von der Grün",
"email": "raphinesse@gmail.com"
},
"files": [
"index.js"
],
"xo": {
"space": 2,
"prettier": true
},
"prettier": {
"bracketSpacing": true,
"semi": false,
"singleQuote": true,
"trailingComma": "es5"
},
"scripts": {
"test": "xo && nyc ava"
},
"dependencies": {
"p-finally": "^1.0.0",
"p-try": "^2.1.0",
"pify": "^4.0.1"
},
"devDependencies": {
"ava": "^1.4.1",
"delay": "^4.1.0",
"nyc": "^14.1.1",
"rewire": "^4.0.1",
"sinon": "^7.3.1",
"xo": "^0.24.0"
},
"engines": {
"node": ">=6"
},
"keywords": [
"node",
"node.js",
"close",
"fd",
"file",
"finally",
"fs",
"open",
"with"
]
}