{"id":40533,"library":"JASON","title":"JASON","description":"JASON is a JSON-like serializer/parser that extends JSON to support objects with methods, cyclic references, Dates, RegExps, Booleans, undefined, and array holes. Current stable version 0.1.3. It uses eval() internally, making it unsafe for untrusted input. Unlike JSON, it preserves object types and allows serialization of complex JavaScript structures, but should only be used in trusted environments. No updates since 2010.","status":"active","version":"0.1.3","language":"javascript","source_language":"en","source_url":"git://github.com/xk/JASON","tags":["javascript"],"install":[{"cmd":"npm install JASON","lang":"bash","label":"npm"},{"cmd":"yarn add JASON","lang":"bash","label":"yarn"},{"cmd":"pnpm add JASON","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM default import. CommonJS require also works but ESM is preferred.","wrong":"const JASON = require('JASON')","symbol":"JASON","correct":"import JASON from 'JASON'"},{"note":"Named export available since 0.1.0.","wrong":"const stringify = JASON.stringify","symbol":"stringify","correct":"import { stringify } from 'JASON'"},{"note":"Named export. parse uses eval internally.","wrong":"const parse = JASON.parse","symbol":"parse","correct":"import { parse } from 'JASON'"}],"quickstart":{"code":"import JASON from 'JASON';\n\nconst obj = {\n  name: 'test',\n  date: new Date(),\n  nested: { arr: [1, 2, undefined, 4] },\n  method: function() { return this.name; },\n  circular: {}\n};\nobj.circular.self = obj;\n\nconst str = JASON.stringify(obj);\nconsole.log(str);\n\nconst parsed = JASON.parse(str);\nconsole.log(parsed.date instanceof Date); // true\nconsole.log(parsed.method()); // 'test'\nconsole.log(parsed.circular.self === parsed); // true","lang":"javascript","description":"Demonstrates stringify and parse of complex objects including methods, dates, undefined, and circular references."},"warnings":[{"fix":"Only use JASON with strings produced by JASON.stringify from a trusted source. Never parse untrusted input.","message":"JASON.parse uses eval() internally, executing arbitrary JavaScript from input strings. This can lead to code injection if the input is not from a fully trusted source.","severity":"gotcha","affected_versions":"*"},{"fix":"Avoid objects with getters or proxies when using JASON. Use a safer serializer like JSON or structured clone for such cases.","message":"JASON.stringify may generate code that, when parsed, re-executes side effects if the object contains getters or Proxy traps. The parsed result may not be identical to the original.","severity":"gotcha","affected_versions":"*"},{"fix":"Convert Map/Set to objects or arrays before serialization. Use Symbol.for() keys with caution.","message":"JASON does not support Map, Set, Symbol, or WeakMap/WeakRef. These will be lost or cause errors during stringification.","severity":"gotcha","affected_versions":"*"},{"fix":"Always use JASON.parse for JASON strings and JASON.stringify for creating them.","message":"JASON is not a drop-in replacement for JSON. JSON.parse and JSON.stringify will not work with JASON-formatted strings and vice versa.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"search_vec":"'0.1.3':29 '2010':64 'allow':47 'array':24 'boolean':21 'complex':50 'current':26 'cyclic':17 'date':19 'environ':60 'eval':32 'extend':10 'hole':25 'input':39 'intern':33 'jason':1,2 'javascript':51,65 'json':6,11,41 'json-lik':5 'like':7 'make':34 'method':16 'object':14,44 'preserv':43 'refer':18 'regexp':20 'serial':48 'serializer/parser':8 'sinc':63 'stabl':27 'structur':52 'support':13 'trust':59 'type':45 'undefin':22 'unlik':40 'unsaf':36 'untrust':38 'updat':62 'use':31,57 'version':28","created_at":"2026-06-04T18:48:02.405832+00:00","updated_at":"2026-06-04T18:48:02.405832+00:00","problems":[{"fix":"Add 'import JASON from \"JASON\"' or 'const JASON = require(\"JASON\")' at the top of the file.","cause":"Missing import or require of JASON.","error":"ReferenceError: JASON is not defined"},{"fix":"Use JASON.stringify instead of JSON.stringify for objects with cycles.","cause":"Using JSON.stringify on an object with circular references.","error":"Error: Converting circular structure to JSON"},{"fix":"Use JASON.stringify and JASON.parse to preserve methods.","cause":"JSON.parse discards methods. The parsed object does not have the original's functions.","error":"TypeError: obj.method is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/xk/JASON","github":"git://github.com/xk/JASON","docs":null,"changelog":null,"pypi":null,"npm":"JASON","openapi_spec":null,"status_page":null,"smithery":null,"categories":["storage"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}