Comments (5)
I tried to minify this json.
Use below code.
// foo.js
var fs = require("fs");
var jsonminify = require("jsonminify");
var raw = fs.readFileSync('/tmp/11240696/gistfile1.txt', 'utf-8');
var out = jsonminify(raw);
console.log("---------");
console.log(out)
console.log("---------");
But output has no whitespece.
$ node foo.js
---------
{"glossary":{"title":"example glossary","GlossDiv":{"title":"S","GlossList":{"GlossEntry":{"ID":"SGML","SortAs":"SGML","GlossTerm":"Standard Generalized Markup Language","Acronym":"SGML","Abbrev":"ISO 8879:1986","GlossDef":{"para":"A meta-markup language, used to create markup languages such as DocBook.","GlossSeeAlso":["GML","XML"]},"GlossSee":"markup"}}}}}
---------
I have no idea why your output has whitespace.
from json.minify.
I have no idea why your output has whitespace.
Perhaps they are tabs, hard-space, or other whitespace that the RegEx doesn't check?
No way to check without seeing the source files inside a .ZIP or 7z archive @syst3mw0rm
from json.minify.
ok, I've uploaded relevant source code here - https://dl.dropboxusercontent.com/u/9555782/json-minify.zip
Code is bit involved than just json minification and it is quite possible that the bug is not in json minify itself but some other piece of code. Code is pretty straightforward to understand and see what's going on. I'm still unable to figure out from where does mysterious trailing whitespaces appear. Help is much appreciated.
from json.minify.
I can get reproduce the bug, but the cause is unknown.
It works correctly with text format (ex: #8 (comment)), so I think server is the cause of this bug.
I'll close this issue, but if you can reproduce the bug with text format(not binary format), give me the code and reopen this issue plase.
from json.minify.
Yeah, not a problem. Probably this ain't issue with json-minify anyway.
But, What do you by reproducing it in text format and giving you the code? I think I already did that.
from json.minify.
Related Issues (11)
- utf8 issues? HOT 1
- jsonminify( [ ] ) --> "" HOT 2
- not remove last whitespaces
- not remove comments last line
- An empty object transforms to an empty string
- Please update JSON.minify(..) for important fix HOT 2
- FreeBSD support HOT 1
- Option to only strip comments, no minify HOT 2
- A command-line utility to remove quickly comments from a json would be of great use HOT 8
- faster minify functions?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from json.minify.