diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2023-10-14 15:58:02 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2023-10-14 15:58:02 +0800 |
| commit | fee47f6414cc3ae9a88f3ee0ed20f1d6f2d9f556 (patch) | |
| tree | 2b99dd57fc676a3819ef3cc46ac43df0043c2bb3 /node_modules/write-file-stdout | |
| parent | 0379526e20e1ff212df23e6326741aa9c06df204 (diff) | |
added plugin from postcss: postcss-fixes rucksack-css
Diffstat (limited to 'node_modules/write-file-stdout')
| -rw-r--r-- | node_modules/write-file-stdout/.npmignore | 1 | ||||
| -rw-r--r-- | node_modules/write-file-stdout/History.md | 7 | ||||
| -rw-r--r-- | node_modules/write-file-stdout/Makefile | 8 | ||||
| -rw-r--r-- | node_modules/write-file-stdout/Readme.md | 17 | ||||
| -rw-r--r-- | node_modules/write-file-stdout/index.js | 20 | ||||
| -rw-r--r-- | node_modules/write-file-stdout/package.json | 15 | ||||
| -rw-r--r-- | node_modules/write-file-stdout/test/index.js | 23 |
7 files changed, 91 insertions, 0 deletions
diff --git a/node_modules/write-file-stdout/.npmignore b/node_modules/write-file-stdout/.npmignore new file mode 100644 index 00000000..b512c09d --- /dev/null +++ b/node_modules/write-file-stdout/.npmignore @@ -0,0 +1 @@ +node_modules
\ No newline at end of file diff --git a/node_modules/write-file-stdout/History.md b/node_modules/write-file-stdout/History.md new file mode 100644 index 00000000..564bf404 --- /dev/null +++ b/node_modules/write-file-stdout/History.md @@ -0,0 +1,7 @@ +0.0.2 - December 19, 2013 +------------------------- +* add repository to package.json + +0.0.1 - December 18, 2013 +------------------------- +:sparkles:
\ No newline at end of file diff --git a/node_modules/write-file-stdout/Makefile b/node_modules/write-file-stdout/Makefile new file mode 100644 index 00000000..b5aa56c1 --- /dev/null +++ b/node_modules/write-file-stdout/Makefile @@ -0,0 +1,8 @@ + +node_modules: package.json + @npm install + +test: node_modules + @mocha --reporter spec + +.PHONY: test
\ No newline at end of file diff --git a/node_modules/write-file-stdout/Readme.md b/node_modules/write-file-stdout/Readme.md new file mode 100644 index 00000000..867a9f70 --- /dev/null +++ b/node_modules/write-file-stdout/Readme.md @@ -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 diff --git a/node_modules/write-file-stdout/index.js b/node_modules/write-file-stdout/index.js new file mode 100644 index 00000000..10d804ec --- /dev/null +++ b/node_modules/write-file-stdout/index.js @@ -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); +} diff --git a/node_modules/write-file-stdout/package.json b/node_modules/write-file-stdout/package.json new file mode 100644 index 00000000..ce3c106d --- /dev/null +++ b/node_modules/write-file-stdout/package.json @@ -0,0 +1,15 @@ +{ + "name": "write-file-stdout", + "repository": "git://github.com/ianstormtaylor/write-file-stdout.git", + "description": "Write to a file, falling back to stdout.", + "keywords": [ + "write", + "file", + "stdout" + ], + "version": "0.0.2", + "license": "MIT", + "devDependencies": { + "mocha": "~1.15.1" + } +} diff --git a/node_modules/write-file-stdout/test/index.js b/node_modules/write-file-stdout/test/index.js new file mode 100644 index 00000000..b0c4ea21 --- /dev/null +++ b/node_modules/write-file-stdout/test/index.js @@ -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'); + }); +});
\ No newline at end of file |
