first commit
This commit is contained in:
1
build/node_modules/write-file-stdout/.npmignore
generated
vendored
Normal file
1
build/node_modules/write-file-stdout/.npmignore
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
node_modules
|
||||
7
build/node_modules/write-file-stdout/History.md
generated
vendored
Normal file
7
build/node_modules/write-file-stdout/History.md
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
0.0.2 - December 19, 2013
|
||||
-------------------------
|
||||
* add repository to package.json
|
||||
|
||||
0.0.1 - December 18, 2013
|
||||
-------------------------
|
||||
:sparkles:
|
||||
8
build/node_modules/write-file-stdout/Makefile
generated
vendored
Normal file
8
build/node_modules/write-file-stdout/Makefile
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
|
||||
node_modules: package.json
|
||||
@npm install
|
||||
|
||||
test: node_modules
|
||||
@mocha --reporter spec
|
||||
|
||||
.PHONY: test
|
||||
17
build/node_modules/write-file-stdout/Readme.md
generated
vendored
Normal file
17
build/node_modules/write-file-stdout/Readme.md
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
# write-file-stdout
|
||||
|
||||
Write to a file, falling back to stdout.
|
||||
|
||||
## Installation
|
||||
|
||||
$ npm install write-file-stdout
|
||||
|
||||
## API
|
||||
|
||||
### write ([file], contents)
|
||||
|
||||
Write `contents` to a `file`, falling back to stdout.
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
20
build/node_modules/write-file-stdout/index.js
generated
vendored
Normal file
20
build/node_modules/write-file-stdout/index.js
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
var fs = require('fs');
|
||||
|
||||
/**
|
||||
* Expose `write`.
|
||||
*/
|
||||
|
||||
module.exports = write;
|
||||
|
||||
/**
|
||||
* Write `contents` to a `file`, falling back to stdout.
|
||||
*
|
||||
* @param {String} file
|
||||
* @param {String} contents
|
||||
*/
|
||||
|
||||
function write (file, contents) {
|
||||
if (1 == arguments.length) contents = file, file = null;
|
||||
if (file) return fs.writeFileSync(file, contents);
|
||||
process.stdout.write(contents);
|
||||
}
|
||||
50
build/node_modules/write-file-stdout/package.json
generated
vendored
Normal file
50
build/node_modules/write-file-stdout/package.json
generated
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"write-file-stdout@0.0.2",
|
||||
"/Users/asciidisco/Desktop/asciidisco.com/build"
|
||||
]
|
||||
],
|
||||
"_from": "write-file-stdout@0.0.2",
|
||||
"_id": "write-file-stdout@0.0.2",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-wlLXx8WxtAKJdjDjRTx7/mkNnKE=",
|
||||
"_location": "/write-file-stdout",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "write-file-stdout@0.0.2",
|
||||
"name": "write-file-stdout",
|
||||
"escapedName": "write-file-stdout",
|
||||
"rawSpec": "0.0.2",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "0.0.2"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/stylehacks"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/write-file-stdout/-/write-file-stdout-0.0.2.tgz",
|
||||
"_spec": "0.0.2",
|
||||
"_where": "/Users/asciidisco/Desktop/asciidisco.com/build",
|
||||
"bugs": {
|
||||
"url": "https://github.com/ianstormtaylor/write-file-stdout/issues"
|
||||
},
|
||||
"description": "Write to a file, falling back to stdout.",
|
||||
"devDependencies": {
|
||||
"mocha": "~1.15.1"
|
||||
},
|
||||
"homepage": "https://github.com/ianstormtaylor/write-file-stdout#readme",
|
||||
"keywords": [
|
||||
"write",
|
||||
"file",
|
||||
"stdout"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "write-file-stdout",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/ianstormtaylor/write-file-stdout.git"
|
||||
},
|
||||
"version": "0.0.2"
|
||||
}
|
||||
23
build/node_modules/write-file-stdout/test/index.js
generated
vendored
Normal file
23
build/node_modules/write-file-stdout/test/index.js
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
|
||||
var assert = require('assert');
|
||||
var fs = require('fs');
|
||||
var write = require('..');
|
||||
|
||||
describe('write-file-stdout', function () {
|
||||
afterEach(function () {
|
||||
if (fs.existsSync('fixture.txt')) fs.unlinkSync('fixture.txt');
|
||||
});
|
||||
|
||||
it('should write to a file', function () {
|
||||
write('fixture.txt', 'test');
|
||||
assert.equal('test', fs.readFileSync('fixture.txt'));
|
||||
});
|
||||
|
||||
it('should write to stdout', function (done) {
|
||||
process.stdout.write = function (data) {
|
||||
assert.equal('test', data);
|
||||
done();
|
||||
};
|
||||
write('test');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user