Template Upload

This commit is contained in:
SOUTHERNCO\x2mjbyrn
2017-05-17 13:45:25 -04:00
parent 415b9c25f3
commit 7efe7605b8
11476 changed files with 2170865 additions and 34 deletions

6
node_modules/write-file-atomic/LICENSE generated vendored Normal file
View File

@ -0,0 +1,6 @@
Copyright (c) 2015, Rebecca Turner
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

44
node_modules/write-file-atomic/README.md generated vendored Normal file
View File

@ -0,0 +1,44 @@
write-file-atomic
-----------------
This is an extension for node's `fs.writeFile` that makes its operation
atomic and allows you set ownership (uid/gid of the file).
### var writeFileAtomic = require('write-file-atomic')<br>writeFileAtomic(filename, data, [options], callback)
* filename **String**
* data **String** | **Buffer**
* options **Object**
* chown **Object**
* uid **Number**
* gid **Number**
* encoding **String** | **Null** default = 'utf8'
* mode **Number** default = 438 (aka 0666 in Octal)
callback **Function**
Atomically and asynchronously writes data to a file, replacing the file if it already
exists. data can be a string or a buffer.
The file is initially named `filename + "." + murmurhex(__filename, process.pid, ++invocations)`.
If writeFile completes successfully then, if passed the **chown** option it will change
the ownership of the file. Finally it renames the file back to the filename you specified. If
it encounters errors at any of these steps it will attempt to unlink the temporary file and then
pass the error back to the caller.
If provided, the **chown** option requires both **uid** and **gid** properties or else
you'll get an error.
The **encoding** option is ignored if **data** is a buffer. It defaults to 'utf8'.
Example:
```javascript
writeFileAtomic('message.txt', 'Hello Node', {chown:{uid:100,gid:50}}, function (err) {
if (err) throw err;
console.log('It\'s saved!');
});
```
### var writeFileAtomicSync = require('write-file-atomic').sync<br>writeFileAtomicSync(filename, data, [options])
The synchronous version of **writeFileAtomic**.

129
node_modules/write-file-atomic/index.js generated vendored Normal file
View File

@ -0,0 +1,129 @@
'use strict'
module.exports = writeFile
module.exports.sync = writeFileSync
module.exports._getTmpname = getTmpname // for testing
var fs = require('graceful-fs')
var chain = require('slide').chain
var MurmurHash3 = require('imurmurhash')
var extend = Object.assign || require('util')._extend
var invocations = 0
function getTmpname (filename) {
return filename + '.' +
MurmurHash3(__filename)
.hash(String(process.pid))
.hash(String(++invocations))
.result()
}
function writeFile (filename, data, options, callback) {
if (options instanceof Function) {
callback = options
options = null
}
if (!options) options = {}
fs.realpath(filename, function (_, realname) {
_writeFile(realname || filename, data, options, callback)
})
}
function _writeFile (filename, data, options, callback) {
var tmpfile = getTmpname(filename)
if (options.mode && options.chown) {
return thenWriteFile()
} else {
// Either mode or chown is not explicitly set
// Default behavior is to copy it from original file
return fs.stat(filename, function (err, stats) {
if (err || !stats) return thenWriteFile()
options = extend({}, options)
if (!options.mode) {
options.mode = stats.mode
}
if (!options.chown && process.getuid) {
options.chown = { uid: stats.uid, gid: stats.gid }
}
return thenWriteFile()
})
}
function thenWriteFile () {
chain([
[writeFileAsync, tmpfile, data, options.mode, options.encoding || 'utf8'],
options.chown && [fs, fs.chown, tmpfile, options.chown.uid, options.chown.gid],
options.mode && [fs, fs.chmod, tmpfile, options.mode],
[fs, fs.rename, tmpfile, filename]
], function (err) {
err ? fs.unlink(tmpfile, function () { callback(err) })
: callback()
})
}
// doing this instead of `fs.writeFile` in order to get the ability to
// call `fsync`.
function writeFileAsync (file, data, mode, encoding, cb) {
fs.open(file, 'w', options.mode, function (err, fd) {
if (err) return cb(err)
if (Buffer.isBuffer(data)) {
return fs.write(fd, data, 0, data.length, 0, syncAndClose)
} else if (data != null) {
return fs.write(fd, String(data), 0, String(encoding), syncAndClose)
} else {
return syncAndClose()
}
function syncAndClose (err) {
if (err) return cb(err)
fs.fsync(fd, function (err) {
if (err) return cb(err)
fs.close(fd, cb)
})
}
})
}
}
function writeFileSync (filename, data, options) {
if (!options) options = {}
try {
filename = fs.realpathSync(filename)
} catch (ex) {
// it's ok, it'll happen on a not yet existing file
}
var tmpfile = getTmpname(filename)
try {
if (!options.mode || !options.chown) {
// Either mode or chown is not explicitly set
// Default behavior is to copy it from original file
try {
var stats = fs.statSync(filename)
options = extend({}, options)
if (!options.mode) {
options.mode = stats.mode
}
if (!options.chown && process.getuid) {
options.chown = { uid: stats.uid, gid: stats.gid }
}
} catch (ex) {
// ignore stat errors
}
}
var fd = fs.openSync(tmpfile, 'w', options.mode)
if (Buffer.isBuffer(data)) {
fs.writeSync(fd, data, 0, data.length, 0)
} else if (data != null) {
fs.writeSync(fd, String(data), 0, String(options.encoding || 'utf8'))
}
fs.fsyncSync(fd)
fs.closeSync(fd)
if (options.chown) fs.chownSync(tmpfile, options.chown.uid, options.chown.gid)
if (options.mode) fs.chmodSync(tmpfile, options.mode)
fs.renameSync(tmpfile, filename)
} catch (err) {
try { fs.unlinkSync(tmpfile) } catch (e) {}
throw err
}
}

97
node_modules/write-file-atomic/package.json generated vendored Normal file
View File

@ -0,0 +1,97 @@
{
"_args": [
[
"write-file-atomic@^1.1.2",
"C:\\Users\\x2mjbyrn\\Source\\Repos\\Skeleton\\node_modules\\configstore"
]
],
"_from": "write-file-atomic@>=1.1.2-0 <2.0.0-0",
"_id": "write-file-atomic@1.3.4",
"_inCache": true,
"_location": "/write-file-atomic",
"_nodeVersion": "7.7.4",
"_npmOperationalInternal": {
"host": "packages-12-west.internal.npmjs.com",
"tmp": "tmp/write-file-atomic-1.3.4.tgz_1493249998004_0.7851631820667535"
},
"_npmUser": {
"email": "me@re-becca.org",
"name": "iarna"
},
"_npmVersion": "4.6.1",
"_phantomChildren": {},
"_requested": {
"name": "write-file-atomic",
"raw": "write-file-atomic@^1.1.2",
"rawSpec": "^1.1.2",
"scope": null,
"spec": ">=1.1.2-0 <2.0.0-0",
"type": "range"
},
"_requiredBy": [
"/configstore"
],
"_resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.3.4.tgz",
"_shasum": "f807a4f0b1d9e913ae7a48112e6cc3af1991b45f",
"_shrinkwrap": null,
"_spec": "write-file-atomic@^1.1.2",
"_where": "C:\\Users\\x2mjbyrn\\Source\\Repos\\Skeleton\\node_modules\\configstore",
"author": {
"email": "me@re-becca.org",
"name": "Rebecca Turner",
"url": "http://re-becca.org"
},
"bugs": {
"url": "https://github.com/iarna/write-file-atomic/issues"
},
"dependencies": {
"graceful-fs": "^4.1.11",
"imurmurhash": "^0.1.4",
"slide": "^1.1.5"
},
"description": "Write files in an atomic fashion w/configurable ownership",
"devDependencies": {
"mkdirp": "^0.5.1",
"require-inject": "^1.4.0",
"rimraf": "^2.5.4",
"standard": "^9.0.2",
"tap": "^10.3.2"
},
"directories": {},
"dist": {
"shasum": "f807a4f0b1d9e913ae7a48112e6cc3af1991b45f",
"tarball": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.3.4.tgz"
},
"files": [
"index.js"
],
"gitHead": "8f7d56f6a62600a38e816a8276a128883f4e7436",
"homepage": "https://github.com/iarna/write-file-atomic",
"installable": true,
"keywords": [
"atomic",
"writeFile"
],
"license": "ISC",
"main": "index.js",
"maintainers": [
{
"name": "iarna",
"email": "me@re-becca.org"
},
{
"name": "othiym23",
"email": "ogd@aoaioxxysz.net"
}
],
"name": "write-file-atomic",
"optionalDependencies": {},
"repository": {
"type": "git",
"url": "git+ssh://git@github.com/iarna/write-file-atomic.git"
},
"scripts": {
"test": "standard && tap --coverage test/*.js"
},
"version": "1.3.4"
}