Coder Social home page Coder Social logo

easyjson's Introduction

EasyJSON

What is EasyJSON?

EasyJSON is a JSON parser for LiveCode, written solely in LiveCode. Use it to put JSON data directly into LiveCode arrays, and to turn a LiveCode array into a valid JSON document.

Alternatives to EasyJSON

Because it is a LiveCode script, EasyJSON can run relatively slowly, compared to an external library, written in a lower-level language. The prolific Monte Goulding has produced an external JSON parser for LiveCode, mergJSON, which runs many orders of magnitude faster than EasyJSON. His acclaimed externals can be found on http://mergext.com.

EasyJSON is based on a LiveCode JSON library originally written by the late Mark Smith. That library can still be found and downloaded online. Some of the code in the script was based on some great code originally developed by Andre Garzia (http://www.andregarzia.com).

How to Use EasyJSON

To use EasyJSON within your LiveCode Server script, just include easyjson.lc in your script.

To use EasyJSON in a LiveCode stack, just copy the contents of the easyjson.lc file - without the opening tags - into your stack script.

There are only 2 functions that you are likely to ever need:

  • jsonFromArray( pArray ) - takes in a LiveCode array, and returns a valid JSON document string.
  • arrayFromJSON( pJson ) - takes JSON data and returns a valid LiveCode array. It expects the JSON data to be presented as a valid JSON document, as described in http://json.org.

These 2 functions in turn require other functions that are part of the EasyJSON library, but you are unlikely to use them directly. If you want more detailed information on how these functions work, have a look at the (heavily commented) script.

License

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OROTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Contributing

EasyJSON is an open source project. The script is thoroughly documented, and you are encouraged to study it, and improve on it.

If you do make any corrections or enhancements to the EasyJSON script, we ask you to please share your code back with the LiveCode community, by sending a pull request here on GitHub!

easyjson's People

Contributors

kant avatar luxlogica avatar mwieder avatar

Watchers

 avatar

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.