-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A command-line utility to remove quickly comments from a json would be of great use #6
Comments
Do you want to run from the command line JSON.minify? Well, I have already made a thing called mjson https://github.com/fkei/node-mjson Please try it here. |
Wow great ! Well excepted a few details
People with unix background will warn you that this is a Useless Use of Cat : http://en.wikipedia.org/wiki/Cat_(Unix)#Useless_use_of_cat) No problem, this does the same job But of course we can do better
I didn't try if it's possible, but mjson.js --help seems to imply that no. I hope this is not a restriciton of node.js, that would be weird :( But wait, standard ouput is fine for using with demo, but it is not what you use once you understand it. More like
or better
But then there is the suggestion I made, inspired by Ruby on Rails's Convention over configuration principle
This would be great because:
Then this has to be documented of course, so a documentatinon pull request has to be opened on I am sure this would be really useful, I hope this is not too much to ask :-) |
@internaciulo Since mjson is a separate project by @fkei I think the request to change the behavior of that utility belongs there in that repo rather than in this thread for JSON.minify. Again, if someone decides at some point to put in a Pull-Request to my main repo that adds in a CLI utility, I'll be happy to consider it. But until then, it's not really a JSON.minify issue. Also, note: it's typical that when you make such requests (to change someone's existing code), you actually put in a Pull-Request with the changes implemented, instead of just expecting the author to change something to your desires. If a utility exists, but it's not exactly what you want, and you can't make the changes to his code, I'd suggest you instead just write a little bash-script wrapper to conform it to your desired usage. |
This is very off topic, but since you bring it there:
I do know that it's typical, but it's really sad, since bug trackers and pull request are aimed primarily at tracking and correcting, well, bugs But ideas, design, feedback are as bit important as code and bugs and it's just awkard to discuss them with pull requests and bug trackers That's why many free software projects that could be great never succeed. They just don't use the apropriate tools like http://uservoice.com/ I promise that I would never use bug trackers to discuss things that are not bugs if I had a choice. But that's just not the cas right now. |
I'll implement this future when I find time. |
Great 👍 |
Hi Added a specification that had requested. Please look by using all means. Document: https://github.com/fkei/node-mjson#command-line-options $ npm install mjson@0.4.1 Finally, I agree completely with @getify opinion. |
Hello fkey, well first thanks a lot 👍 I have so much projects right now, that I can't do much right now. But I promise I will look at what you did, see what I can do to improve it or just tell the world if it is already perfect :-D |
Hello fkei,
I need to be able to minify a given json file from the command-line
(I'm on macosx, but with homebrew, node, python, ... everything installed) so that I can do
$ jsonminify manifest-with-comments.json --output manifest.json
actually, that would be even best if the command-line utility would be clever enough to just Do What I Want. "Oh, the filename follows this
-with-comments.json
conention". So the following command would be a shortcut as the one before$ jsonminify manifest-with-comments.json
manifest-with-comments.json
being here a file in my little free software project https://github.com/internaciulo/search-tab-in-chrome-s-omniboxI opened an issue there getify#13
@getify replied: No such command-line tool exists in this project. I would suggest asking the maintainer of that npm package if they'll make a command-line tool. It's pretty easy to do, but it just hasn't been done here. I would accept a pull request from someone if they implemented a good one.
Hence this new issue here.
Arigato!
The text was updated successfully, but these errors were encountered: