Canop / JSON.prune

A pruning version of JSON.stringify, allowing for example to stringify window or any big or recursive object
MIT License
163 stars 27 forks source link

Common JS & NPM #3

Closed Hiswe closed 9 years ago

Hiswe commented 9 years ago

Hi, thank you for this piece of code :) It just helps me a lot 5 minutes ago.

I was wondering if it was possible to make this a commonJS module and publish it to NPM?

so we'll be able to make something like

var prune  = require('json-prune');

prune(obj);

Thanks again!

Canop commented 9 years ago

Can you review this branch and tell me if it looks OK to you ? https://github.com/Canop/JSON.prune/tree/npm

If it's OK, I'll register the module in the npm registry then I'll merge the branch into master.

Hiswe commented 9 years ago

Hi Canop :)

Thanks for the quick answer!

It seems ok for me :) but you can even improve with a requireJS support.

I think this patten should fit

Hiswe commented 9 years ago

I've forget something: you'll need to provide a package.json in order to publish it on NPM registry ¬_¬'

A npm init should generate it. The only thing should be the set the "main" to "JSON.prune.js"

Canop commented 9 years ago

Published: https://www.npmjs.com/package/json-prune

I won't clutter the code for requirejs unless somebody really needs it. I don't think it's the future.

Hiswe commented 9 years ago

@Canop That's perfect! Thank you very much.

For requireJs , with ES6 modules, you should be right :)