Coder Social home page Coder Social logo

buffer-json's People

Contributors

jprichardson avatar lachenmayer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

buffer-json's Issues

JSON.parse and JSON.stringify

What does this library offer over the follow native solution?

const buf = Buffer.from(JSON.stringify(obj));
const json = JSON.parse(buf.toString());

Rewrite

Hi JP, I've been using this library in a project and noticed that it crashes when keys are undefined, as can be seen in this Runkit.

var bufferJson = require("buffer-json")
JSON.stringify({ohNo: undefined}, bufferJson.replacer)
// => TypeError: Cannot read property 'type' of undefined

This is the same bug that caused PR #1.

Because I needed to make progress, I forked the project & fixed the bug - I noticed that the module is quite outdated now, so it resulted in a complete rewrite (ie. it is currently using the deprecated Buffer constructor, deprecated mocha methods etc.): https://github.com/lachenmayer/buffer-json

I'm happy to use the fork namespaced under my name for now (@lachenmayer/buffer-json), but it might be useful to others too. I also made the documentation a bit clearer & removed all the references to Node 0.10, as they're not really relevant anymore.

I haven't opened a PR for this, as I'm not sure if you want to keep maintaining this module and merge in the changes, or if it would be more useful transfer ownership and/or mark this repo as deprecated. Let me know what works for you.

Thanks a lot!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.