Bump @justinribeiro/lite-youtube from 0.9.0 to 0.9.1 in /build/javascript (#273)
* Commit updated Javascript packages * Bump preact from 10.5.4 to 10.5.5 in /build/javascript (#265) * Trying a new github workflow to install javascript packages * Bump tailwindcss from 1.9.2 to 1.9.4 in /build/javascript (#266) Bumps [tailwindcss](https://github.com/tailwindlabs/tailwindcss) from 1.9.2 to 1.9.4. - [Release notes](https://github.com/tailwindlabs/tailwindcss/releases) - [Changelog](https://github.com/tailwindlabs/tailwindcss/blob/master/CHANGELOG.md) - [Commits](https://github.com/tailwindlabs/tailwindcss/compare/v1.9.2...v1.9.4) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Commit updated Javascript packages * Bump preact from 10.5.4 to 10.5.5 in /build/javascript Bumps [preact](https://github.com/preactjs/preact) from 10.5.4 to 10.5.5. - [Release notes](https://github.com/preactjs/preact/releases) - [Commits](https://github.com/preactjs/preact/compare/10.5.4...10.5.5) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Gabe Kangas <gabek@real-ity.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Owncast <owncast@owncast.online> * Bump @justinribeiro/lite-youtube in /build/javascript Bumps [@justinribeiro/lite-youtube](https://github.com/justinribeiro/lite-youtube) from 0.9.0 to 0.9.1. - [Release notes](https://github.com/justinribeiro/lite-youtube/releases) - [Commits](https://github.com/justinribeiro/lite-youtube/commits) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Owncast <owncast@owncast.online> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Gabe Kangas <gabek@real-ity.com>
This commit is contained in:
152
build/javascript/node_modules/jsonfile/CHANGELOG.md
generated
vendored
Normal file
152
build/javascript/node_modules/jsonfile/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,152 @@
|
||||
5.0.0 / 2018-09-08
|
||||
------------------
|
||||
|
||||
- **BREAKING:** Drop Node 4 support
|
||||
- **BREAKING:** If no callback is passed to an asynchronous method, a promise is now returned ([#109](https://github.com/jprichardson/node-jsonfile/pull/109))
|
||||
- Cleanup docs
|
||||
|
||||
4.0.0 / 2017-07-12
|
||||
------------------
|
||||
|
||||
- **BREAKING:** Remove global `spaces` option.
|
||||
- **BREAKING:** Drop support for Node 0.10, 0.12, and io.js.
|
||||
- Remove undocumented `passParsingErrors` option.
|
||||
- Added `EOL` override option to `writeFile` when using `spaces`. [#89]
|
||||
|
||||
3.0.1 / 2017-07-05
|
||||
------------------
|
||||
|
||||
- Fixed bug in `writeFile` when there was a serialization error & no callback was passed. In previous versions, an empty file would be written; now no file is written.
|
||||
|
||||
3.0.0 / 2017-04-25
|
||||
------------------
|
||||
|
||||
- Changed behavior of `throws` option for `readFileSync`; now does not throw filesystem errors when `throws` is `false`
|
||||
|
||||
2.4.0 / 2016-09-15
|
||||
------------------
|
||||
### Changed
|
||||
- added optional support for `graceful-fs` [#62]
|
||||
|
||||
2.3.1 / 2016-05-13
|
||||
------------------
|
||||
- fix to support BOM. [#45][#45]
|
||||
|
||||
2.3.0 / 2016-04-16
|
||||
------------------
|
||||
- add `throws` to `readFile()`. See [#39][#39]
|
||||
- add support for any arbitrary `fs` module. Useful with [mock-fs](https://www.npmjs.com/package/mock-fs)
|
||||
|
||||
2.2.3 / 2015-10-14
|
||||
------------------
|
||||
- include file name in parse error. See: https://github.com/jprichardson/node-jsonfile/pull/34
|
||||
|
||||
2.2.2 / 2015-09-16
|
||||
------------------
|
||||
- split out tests into separate files
|
||||
- fixed `throws` when set to `true` in `readFileSync()`. See: https://github.com/jprichardson/node-jsonfile/pull/33
|
||||
|
||||
2.2.1 / 2015-06-25
|
||||
------------------
|
||||
- fixed regression when passing in string as encoding for options in `writeFile()` and `writeFileSync()`. See: https://github.com/jprichardson/node-jsonfile/issues/28
|
||||
|
||||
2.2.0 / 2015-06-25
|
||||
------------------
|
||||
- added `options.spaces` to `writeFile()` and `writeFileSync()`
|
||||
|
||||
2.1.2 / 2015-06-22
|
||||
------------------
|
||||
- fixed if passed `readFileSync(file, 'utf8')`. See: https://github.com/jprichardson/node-jsonfile/issues/25
|
||||
|
||||
2.1.1 / 2015-06-19
|
||||
------------------
|
||||
- fixed regressions if `null` is passed for options. See: https://github.com/jprichardson/node-jsonfile/issues/24
|
||||
|
||||
2.1.0 / 2015-06-19
|
||||
------------------
|
||||
- cleanup: JavaScript Standard Style, rename files, dropped terst for assert
|
||||
- methods now support JSON revivers/replacers
|
||||
|
||||
2.0.1 / 2015-05-24
|
||||
------------------
|
||||
- update license attribute https://github.com/jprichardson/node-jsonfile/pull/21
|
||||
|
||||
2.0.0 / 2014-07-28
|
||||
------------------
|
||||
* added `\n` to end of file on write. [#14](https://github.com/jprichardson/node-jsonfile/pull/14)
|
||||
* added `options.throws` to `readFileSync()`
|
||||
* dropped support for Node v0.8
|
||||
|
||||
1.2.0 / 2014-06-29
|
||||
------------------
|
||||
* removed semicolons
|
||||
* bugfix: passed `options` to `fs.readFile` and `fs.readFileSync`. This technically changes behavior, but
|
||||
changes it according to docs. [#12][#12]
|
||||
|
||||
1.1.1 / 2013-11-11
|
||||
------------------
|
||||
* fixed catching of callback bug (ffissore / #5)
|
||||
|
||||
1.1.0 / 2013-10-11
|
||||
------------------
|
||||
* added `options` param to methods, (seanodell / #4)
|
||||
|
||||
1.0.1 / 2013-09-05
|
||||
------------------
|
||||
* removed `homepage` field from package.json to remove NPM warning
|
||||
|
||||
1.0.0 / 2013-06-28
|
||||
------------------
|
||||
* added `.npmignore`, #1
|
||||
* changed spacing default from `4` to `2` to follow Node conventions
|
||||
|
||||
0.0.1 / 2012-09-10
|
||||
------------------
|
||||
* Initial release.
|
||||
|
||||
[#89]: https://github.com/jprichardson/node-jsonfile/pull/89
|
||||
[#45]: https://github.com/jprichardson/node-jsonfile/issues/45 "Reading of UTF8-encoded (w/ BOM) files fails"
|
||||
[#44]: https://github.com/jprichardson/node-jsonfile/issues/44 "Extra characters in written file"
|
||||
[#43]: https://github.com/jprichardson/node-jsonfile/issues/43 "Prettyfy json when written to file"
|
||||
[#42]: https://github.com/jprichardson/node-jsonfile/pull/42 "Moved fs.readFileSync within the try/catch"
|
||||
[#41]: https://github.com/jprichardson/node-jsonfile/issues/41 "Linux: Hidden file not working"
|
||||
[#40]: https://github.com/jprichardson/node-jsonfile/issues/40 "autocreate folder doesn't work from Path-value"
|
||||
[#39]: https://github.com/jprichardson/node-jsonfile/pull/39 "Add `throws` option for readFile (async)"
|
||||
[#38]: https://github.com/jprichardson/node-jsonfile/pull/38 "Update README.md writeFile[Sync] signature"
|
||||
[#37]: https://github.com/jprichardson/node-jsonfile/pull/37 "support append file"
|
||||
[#36]: https://github.com/jprichardson/node-jsonfile/pull/36 "Add typescript definition file."
|
||||
[#35]: https://github.com/jprichardson/node-jsonfile/pull/35 "Add typescript definition file."
|
||||
[#34]: https://github.com/jprichardson/node-jsonfile/pull/34 "readFile JSON parse error includes filename"
|
||||
[#33]: https://github.com/jprichardson/node-jsonfile/pull/33 "fix throw->throws typo in readFileSync()"
|
||||
[#32]: https://github.com/jprichardson/node-jsonfile/issues/32 "readFile & readFileSync can possible have strip-comments as an option?"
|
||||
[#31]: https://github.com/jprichardson/node-jsonfile/pull/31 "[Modify] Support string include is unicode escape string"
|
||||
[#30]: https://github.com/jprichardson/node-jsonfile/issues/30 "How to use Jsonfile package in Meteor.js App?"
|
||||
[#29]: https://github.com/jprichardson/node-jsonfile/issues/29 "writefile callback if no error?"
|
||||
[#28]: https://github.com/jprichardson/node-jsonfile/issues/28 "writeFile options argument broken "
|
||||
[#27]: https://github.com/jprichardson/node-jsonfile/pull/27 "Use svg instead of png to get better image quality"
|
||||
[#26]: https://github.com/jprichardson/node-jsonfile/issues/26 "Breaking change to fs-extra"
|
||||
[#25]: https://github.com/jprichardson/node-jsonfile/issues/25 "support string encoding param for read methods"
|
||||
[#24]: https://github.com/jprichardson/node-jsonfile/issues/24 "readFile: Passing in null options with a callback throws an error"
|
||||
[#23]: https://github.com/jprichardson/node-jsonfile/pull/23 "Add appendFile and appendFileSync"
|
||||
[#22]: https://github.com/jprichardson/node-jsonfile/issues/22 "Default value for spaces in readme.md is outdated"
|
||||
[#21]: https://github.com/jprichardson/node-jsonfile/pull/21 "Update license attribute"
|
||||
[#20]: https://github.com/jprichardson/node-jsonfile/issues/20 "Add simple caching functionallity"
|
||||
[#19]: https://github.com/jprichardson/node-jsonfile/pull/19 "Add appendFileSync method"
|
||||
[#18]: https://github.com/jprichardson/node-jsonfile/issues/18 "Add updateFile and updateFileSync methods"
|
||||
[#17]: https://github.com/jprichardson/node-jsonfile/issues/17 "seem read & write sync has sequentially problem"
|
||||
[#16]: https://github.com/jprichardson/node-jsonfile/pull/16 "export spaces defaulted to null"
|
||||
[#15]: https://github.com/jprichardson/node-jsonfile/issues/15 "`jsonfile.spaces` should default to `null`"
|
||||
[#14]: https://github.com/jprichardson/node-jsonfile/pull/14 "Add EOL at EOF"
|
||||
[#13]: https://github.com/jprichardson/node-jsonfile/issues/13 "Add a final newline"
|
||||
[#12]: https://github.com/jprichardson/node-jsonfile/issues/12 "readFile doesn't accept options"
|
||||
[#11]: https://github.com/jprichardson/node-jsonfile/pull/11 "Added try,catch to readFileSync"
|
||||
[#10]: https://github.com/jprichardson/node-jsonfile/issues/10 "No output or error from writeFile"
|
||||
[#9]: https://github.com/jprichardson/node-jsonfile/pull/9 "Change 'js' to 'jf' in example."
|
||||
[#8]: https://github.com/jprichardson/node-jsonfile/pull/8 "Updated forgotten module.exports to me."
|
||||
[#7]: https://github.com/jprichardson/node-jsonfile/pull/7 "Add file name in error message"
|
||||
[#6]: https://github.com/jprichardson/node-jsonfile/pull/6 "Use graceful-fs when possible"
|
||||
[#5]: https://github.com/jprichardson/node-jsonfile/pull/5 "Jsonfile doesn't behave nicely when used inside a test suite."
|
||||
[#4]: https://github.com/jprichardson/node-jsonfile/pull/4 "Added options parameter to writeFile and writeFileSync"
|
||||
[#3]: https://github.com/jprichardson/node-jsonfile/issues/3 "test2"
|
||||
[#2]: https://github.com/jprichardson/node-jsonfile/issues/2 "homepage field must be a string url. Deleted."
|
||||
[#1]: https://github.com/jprichardson/node-jsonfile/pull/1 "adding an `.npmignore` file"
|
||||
15
build/javascript/node_modules/jsonfile/LICENSE
generated
vendored
Normal file
15
build/javascript/node_modules/jsonfile/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
(The MIT License)
|
||||
|
||||
Copyright (c) 2012-2015, JP Richardson <jprichardson@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.
|
||||
193
build/javascript/node_modules/jsonfile/README.md
generated
vendored
Normal file
193
build/javascript/node_modules/jsonfile/README.md
generated
vendored
Normal file
@@ -0,0 +1,193 @@
|
||||
Node.js - jsonfile
|
||||
================
|
||||
|
||||
Easily read/write JSON files in Node.js. _Note: this module cannot be used in the browser._
|
||||
|
||||
[](https://www.npmjs.org/package/jsonfile)
|
||||
[](http://travis-ci.org/jprichardson/node-jsonfile)
|
||||
[](https://ci.appveyor.com/project/jprichardson/node-jsonfile/branch/master)
|
||||
|
||||
<a href="https://github.com/feross/standard"><img src="https://cdn.rawgit.com/feross/standard/master/sticker.svg" alt="Standard JavaScript" width="100"></a>
|
||||
|
||||
Why?
|
||||
----
|
||||
|
||||
Writing `JSON.stringify()` and then `fs.writeFile()` and `JSON.parse()` with `fs.readFile()` enclosed in `try/catch` blocks became annoying.
|
||||
|
||||
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
npm install --save jsonfile
|
||||
|
||||
|
||||
|
||||
API
|
||||
---
|
||||
|
||||
### readFile(filename, [options], callback)
|
||||
|
||||
`options` (`object`, default `undefined`): Pass in any `fs.readFile` options or set `reviver` for a [JSON reviver](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse).
|
||||
- `throws` (`boolean`, default: `true`). If `JSON.parse` throws an error, pass this error to the callback.
|
||||
If `false`, returns `null` for the object.
|
||||
|
||||
|
||||
```js
|
||||
const jsonfile = require('jsonfile')
|
||||
const file = '/tmp/data.json'
|
||||
jsonfile.readFile(file, function (err, obj) {
|
||||
if (err) console.error(err)
|
||||
console.dir(obj)
|
||||
})
|
||||
```
|
||||
|
||||
You can also use this method with promises. The `readFile` method will return a promise if you do not pass a callback function.
|
||||
|
||||
```js
|
||||
const jsonfile = require('jsonfile')
|
||||
const file = '/tmp/data.json'
|
||||
jsonfile.readFile(file)
|
||||
.then(obj => console.dir(obj))
|
||||
.catch(error => console.error(error))
|
||||
```
|
||||
|
||||
### readFileSync(filename, [options])
|
||||
|
||||
`options` (`object`, default `undefined`): Pass in any `fs.readFileSync` options or set `reviver` for a [JSON reviver](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse).
|
||||
- `throws` (`boolean`, default: `true`). If an error is encountered reading or parsing the file, throw the error. If `false`, returns `null` for the object.
|
||||
|
||||
```js
|
||||
const jsonfile = require('jsonfile')
|
||||
const file = '/tmp/data.json'
|
||||
|
||||
console.dir(jsonfile.readFileSync(file))
|
||||
```
|
||||
|
||||
|
||||
### writeFile(filename, obj, [options], callback)
|
||||
|
||||
`options`: Pass in any `fs.writeFile` options or set `replacer` for a [JSON replacer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify). Can also pass in `spaces` and override `EOL` string.
|
||||
|
||||
|
||||
```js
|
||||
const jsonfile = require('jsonfile')
|
||||
|
||||
const file = '/tmp/data.json'
|
||||
const obj = { name: 'JP' }
|
||||
|
||||
jsonfile.writeFile(file, obj, function (err) {
|
||||
if (err) console.error(err)
|
||||
})
|
||||
```
|
||||
Or use with promises as follows:
|
||||
|
||||
```js
|
||||
const jsonfile = require('jsonfile')
|
||||
|
||||
const file = '/tmp/data.json'
|
||||
const obj = { name: 'JP' }
|
||||
|
||||
jsonfile.writeFile(file, obj)
|
||||
.then(res => {
|
||||
console.log('Write complete')
|
||||
})
|
||||
.catch(error => console.error(error))
|
||||
```
|
||||
|
||||
|
||||
**formatting with spaces:**
|
||||
|
||||
```js
|
||||
const jsonfile = require('jsonfile')
|
||||
|
||||
const file = '/tmp/data.json'
|
||||
const obj = { name: 'JP' }
|
||||
|
||||
jsonfile.writeFile(file, obj, { spaces: 2 }, function (err) {
|
||||
if (err) console.error(err)
|
||||
})
|
||||
```
|
||||
|
||||
**overriding EOL:**
|
||||
|
||||
```js
|
||||
const jsonfile = require('jsonfile')
|
||||
|
||||
const file = '/tmp/data.json'
|
||||
const obj = { name: 'JP' }
|
||||
|
||||
jsonfile.writeFile(file, obj, { spaces: 2, EOL: '\r\n' }, function (err) {
|
||||
if (err) console.error(err)
|
||||
})
|
||||
```
|
||||
|
||||
**appending to an existing JSON file:**
|
||||
|
||||
You can use `fs.writeFile` option `{ flag: 'a' }` to achieve this.
|
||||
|
||||
```js
|
||||
const jsonfile = require('jsonfile')
|
||||
|
||||
const file = '/tmp/mayAlreadyExistedData.json'
|
||||
const obj = { name: 'JP' }
|
||||
|
||||
jsonfile.writeFile(file, obj, { flag: 'a' }, function (err) {
|
||||
if (err) console.error(err)
|
||||
})
|
||||
```
|
||||
|
||||
### writeFileSync(filename, obj, [options])
|
||||
|
||||
`options`: Pass in any `fs.writeFileSync` options or set `replacer` for a [JSON replacer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify). Can also pass in `spaces` and override `EOL` string.
|
||||
|
||||
```js
|
||||
const jsonfile = require('jsonfile')
|
||||
|
||||
const file = '/tmp/data.json'
|
||||
const obj = { name: 'JP' }
|
||||
|
||||
jsonfile.writeFileSync(file, obj)
|
||||
```
|
||||
|
||||
**formatting with spaces:**
|
||||
|
||||
```js
|
||||
const jsonfile = require('jsonfile')
|
||||
|
||||
const file = '/tmp/data.json'
|
||||
const obj = { name: 'JP' }
|
||||
|
||||
jsonfile.writeFileSync(file, obj, { spaces: 2 })
|
||||
```
|
||||
|
||||
**overriding EOL:**
|
||||
|
||||
```js
|
||||
const jsonfile = require('jsonfile')
|
||||
|
||||
const file = '/tmp/data.json'
|
||||
const obj = { name: 'JP' }
|
||||
|
||||
jsonfile.writeFileSync(file, obj, { spaces: 2, EOL: '\r\n' })
|
||||
```
|
||||
|
||||
**appending to an existing JSON file:**
|
||||
|
||||
You can use `fs.writeFileSync` option `{ flag: 'a' }` to achieve this.
|
||||
|
||||
```js
|
||||
const jsonfile = require('jsonfile')
|
||||
|
||||
const file = '/tmp/mayAlreadyExistedData.json'
|
||||
const obj = { name: 'JP' }
|
||||
|
||||
jsonfile.writeFileSync(file, obj, { flag: 'a' })
|
||||
```
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
(MIT License)
|
||||
|
||||
Copyright 2012-2016, JP Richardson <jprichardson@gmail.com>
|
||||
137
build/javascript/node_modules/jsonfile/index.js
generated
vendored
Normal file
137
build/javascript/node_modules/jsonfile/index.js
generated
vendored
Normal file
@@ -0,0 +1,137 @@
|
||||
let _fs
|
||||
try {
|
||||
_fs = require('graceful-fs')
|
||||
} catch (_) {
|
||||
_fs = require('fs')
|
||||
}
|
||||
const universalify = require('universalify')
|
||||
|
||||
function readFileWithCallback (file, options, callback) {
|
||||
if (callback == null) {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
|
||||
if (typeof options === 'string') {
|
||||
options = { encoding: options }
|
||||
}
|
||||
|
||||
options = options || {}
|
||||
const fs = options.fs || _fs
|
||||
|
||||
let shouldThrow = true
|
||||
if ('throws' in options) {
|
||||
shouldThrow = options.throws
|
||||
}
|
||||
|
||||
fs.readFile(file, options, (err, data) => {
|
||||
if (err) return callback(err)
|
||||
|
||||
data = stripBom(data)
|
||||
|
||||
let obj
|
||||
try {
|
||||
obj = JSON.parse(data, options ? options.reviver : null)
|
||||
} catch (err2) {
|
||||
if (shouldThrow) {
|
||||
err2.message = `${file}: ${err2.message}`
|
||||
return callback(err2)
|
||||
} else {
|
||||
return callback(null, null)
|
||||
}
|
||||
}
|
||||
|
||||
callback(null, obj)
|
||||
})
|
||||
}
|
||||
|
||||
const readFile = universalify.fromCallback(readFileWithCallback)
|
||||
|
||||
function readFileSync (file, options) {
|
||||
options = options || {}
|
||||
if (typeof options === 'string') {
|
||||
options = { encoding: options }
|
||||
}
|
||||
|
||||
const fs = options.fs || _fs
|
||||
|
||||
let shouldThrow = true
|
||||
if ('throws' in options) {
|
||||
shouldThrow = options.throws
|
||||
}
|
||||
|
||||
try {
|
||||
let content = fs.readFileSync(file, options)
|
||||
content = stripBom(content)
|
||||
return JSON.parse(content, options.reviver)
|
||||
} catch (err) {
|
||||
if (shouldThrow) {
|
||||
err.message = `${file}: ${err.message}`
|
||||
throw err
|
||||
} else {
|
||||
return null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function stringify (obj, options) {
|
||||
let spaces
|
||||
let EOL = '\n'
|
||||
if (typeof options === 'object' && options !== null) {
|
||||
if (options.spaces) {
|
||||
spaces = options.spaces
|
||||
}
|
||||
if (options.EOL) {
|
||||
EOL = options.EOL
|
||||
}
|
||||
}
|
||||
|
||||
const str = JSON.stringify(obj, options ? options.replacer : null, spaces)
|
||||
|
||||
return str.replace(/\n/g, EOL) + EOL
|
||||
}
|
||||
|
||||
function writeFileWithCallback (file, obj, options, callback) {
|
||||
if (callback == null) {
|
||||
callback = options
|
||||
options = {}
|
||||
}
|
||||
options = options || {}
|
||||
const fs = options.fs || _fs
|
||||
|
||||
let str = ''
|
||||
try {
|
||||
str = stringify(obj, options)
|
||||
} catch (err) {
|
||||
return callback(err, null)
|
||||
}
|
||||
|
||||
fs.writeFile(file, str, options, callback)
|
||||
}
|
||||
|
||||
const writeFile = universalify.fromCallback(writeFileWithCallback)
|
||||
|
||||
function writeFileSync (file, obj, options) {
|
||||
options = options || {}
|
||||
const fs = options.fs || _fs
|
||||
|
||||
const str = stringify(obj, options)
|
||||
// not sure if fs.writeFileSync returns anything, but just in case
|
||||
return fs.writeFileSync(file, str, options)
|
||||
}
|
||||
|
||||
function stripBom (content) {
|
||||
// we do this because JSON.parse would convert it to a utf8 string if encoding wasn't specified
|
||||
if (Buffer.isBuffer(content)) content = content.toString('utf8')
|
||||
content = content.replace(/^\uFEFF/, '')
|
||||
return content
|
||||
}
|
||||
|
||||
const jsonfile = {
|
||||
readFile,
|
||||
readFileSync,
|
||||
writeFile,
|
||||
writeFileSync
|
||||
}
|
||||
|
||||
module.exports = jsonfile
|
||||
75
build/javascript/node_modules/jsonfile/package.json
generated
vendored
Normal file
75
build/javascript/node_modules/jsonfile/package.json
generated
vendored
Normal file
@@ -0,0 +1,75 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"jsonfile@5.0.0",
|
||||
"/home/runner/work/owncast/owncast/build/javascript"
|
||||
]
|
||||
],
|
||||
"_from": "jsonfile@5.0.0",
|
||||
"_id": "jsonfile@5.0.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-NQRZ5CRo74MhMMC3/3r5g2k4fjodJ/wh8MxjFbCViWKFjxrnudWSY5vomh+23ZaXzAS7J3fBZIR2dV6WbmfM0w==",
|
||||
"_location": "/jsonfile",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "jsonfile@5.0.0",
|
||||
"name": "jsonfile",
|
||||
"escapedName": "jsonfile",
|
||||
"rawSpec": "5.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "5.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/twemoji"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-5.0.0.tgz",
|
||||
"_spec": "5.0.0",
|
||||
"_where": "/home/runner/work/owncast/owncast/build/javascript",
|
||||
"author": {
|
||||
"name": "JP Richardson",
|
||||
"email": "jprichardson@gmail.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/jprichardson/node-jsonfile/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"graceful-fs": "^4.1.6",
|
||||
"universalify": "^0.1.2"
|
||||
},
|
||||
"description": "Easily read/write JSON files.",
|
||||
"devDependencies": {
|
||||
"mocha": "^5.2.0",
|
||||
"rimraf": "^2.4.0",
|
||||
"standard": "^12.0.1"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/jprichardson/node-jsonfile#readme",
|
||||
"keywords": [
|
||||
"read",
|
||||
"write",
|
||||
"file",
|
||||
"json",
|
||||
"fs",
|
||||
"fs-extra"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"name": "jsonfile",
|
||||
"optionalDependencies": {
|
||||
"graceful-fs": "^4.1.6"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+ssh://git@github.com/jprichardson/node-jsonfile.git"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "standard",
|
||||
"test": "npm run lint && npm run unit",
|
||||
"unit": "mocha"
|
||||
},
|
||||
"version": "5.0.0"
|
||||
}
|
||||
Reference in New Issue
Block a user