-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from paulvollmer/develop
v0.1.0
- Loading branch information
Showing
23 changed files
with
11,818 additions
and
648 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,60 @@ | ||
/node_modules | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# Typescript v1 declaration files | ||
typings/ | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
|
||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,24 @@ | ||
BIN = ./node_modules/.bin | ||
LINT_SRC = webpack.config.js cmd/jsonfix src test | ||
|
||
all: lint test | ||
|
||
lint: | ||
@$(BIN)/eslint . | ||
@$(BIN)/eslint ${LINT_SRC} | ||
|
||
lint-fix: | ||
@$(BIN)/eslint --fix . | ||
@$(BIN)/eslint --fix ${LINT_SRC} | ||
|
||
test: | ||
@$(BIN)/mocha | ||
@$(BIN)/mocha test/*.test.js | ||
|
||
build: | ||
@$(BIN)/webpack --progress -p | ||
|
||
clean: | ||
rm -rf web/build | ||
|
||
serve: | ||
@$(BIN)/serve | ||
|
||
.PHONY: lint lint-fix test | ||
.PHONY: lint lint-fix test build clean serve |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env node | ||
|
||
'use strict'; | ||
|
||
let fs = require('fs'); | ||
let JSONFix = require('../src/jsonfix'); | ||
|
||
if (process.argv.length === 2) { | ||
process.stderr.write('missing input file\n'); | ||
process.exit(1); | ||
} else if (process.argv.length === 3) { | ||
let filepath = process.argv[2]; | ||
fs.readFile(filepath, {encoding: 'utf8'}, function(err, data) { | ||
if (err !== null) { | ||
process.stderr.write('cannot read file "'+process.argv[2]+'"\n'); | ||
process.exit(1); | ||
} else { | ||
let result = JSONFix.process(data); | ||
|
||
// debug stuff | ||
// console.log('============'); | ||
// console.log('isValid = '+JSONFix.isValid); | ||
// console.log('wasFixed = '+JSONFix.wasFixed); | ||
// console.log('message = '+JSONFix.message); | ||
// console.log('totalTries = '+JSONFix.stats.totalTries); | ||
// console.log(JSON.stringify(JSONFix, null, 2)); | ||
// console.log('============'); | ||
|
||
process.stdout.write(JSON.stringify(result, null, 2)+'\n'); | ||
} | ||
}); | ||
} |
Oops, something went wrong.