Skip to content
This repository has been archived by the owner on Dec 4, 2018. It is now read-only.

Commit

Permalink
all the damn browser bundlers dropped support for node.js so if you h…
Browse files Browse the repository at this point in the history
…ave #! in the file everyone complains about it
  • Loading branch information
dominictarr committed Dec 17, 2017
1 parent 71ab561 commit debb492
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
12 changes: 12 additions & 0 deletions bin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#! /usr/bin/env node

var JSONStream = require('./')

if(!module.parent && process.title !== 'browser') {
process.stdin
.pipe(JSONStream.parse(process.argv[2]))
.pipe(JSONStream.stringify('[', ',\n', ']\n', 2))
.pipe(process.stdout)
}


8 changes: 0 additions & 8 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#! /usr/bin/env node

'use strict'

var Parser = require('jsonparse')
Expand Down Expand Up @@ -244,10 +242,4 @@ exports.stringifyObject = function (op, sep, cl, indent) {
return stream
}

if(!module.parent && process.title !== 'browser') {
process.stdin
.pipe(exports.parse(process.argv[2]))
.pipe(exports.stringify('[', ',\n', ']\n', 2))
.pipe(process.stdout)
}

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"event-stream": "~0.7.0",
"tape": "~2.12.3"
},
"bin": "./index.js",
"bin": "./bin.js",
"author": "Dominic Tarr <dominic.tarr@gmail.com> (http://bit.ly/dominictarr)",
"scripts": {
"test": "set -e; for t in test/*.js; do echo '***' $t '***'; node $t; done"
Expand Down

0 comments on commit debb492

Please sign in to comment.