{"id":13653044,"url":"https://github.com/bevry/cson","last_synced_at":"2025-05-14T09:09:35.384Z","repository":{"id":1536723,"uuid":"1835751","full_name":"bevry/cson","owner":"bevry","description":"CoffeeScript-Object-Notation. Same as JSON but for CoffeeScript objects.","archived":false,"fork":false,"pushed_at":"2023-12-30T16:15:39.000Z","size":695,"stargazers_count":1343,"open_issues_count":2,"forks_count":56,"subscribers_count":24,"default_branch":"master","last_synced_at":"2024-10-29T15:35:57.390Z","etag":null,"topics":["coffeescript","cson","data-format","executable","json","nodejs"],"latest_commit_sha":null,"homepage":"","language":"CoffeeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bevry.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"github":["balupton"],"patreon":"bevry","open_collective":"bevry","ko_fi":"balupton","liberapay":"bevry","tidelift":"npm/cson","custom":["https://bevry.me/fund"]}},"created_at":"2011-06-02T05:37:50.000Z","updated_at":"2024-10-25T11:27:28.000Z","dependencies_parsed_at":"2023-11-29T04:37:40.701Z","dependency_job_id":"5aa0ec97-f03f-40f4-8645-1465b7d8d6a4","html_url":"https://github.com/bevry/cson","commit_stats":{"total_commits":188,"total_committers":16,"mean_commits":11.75,"dds":0.2872340425531915,"last_synced_commit":"078f6120a75dc0d7cc06111f485d1aff3459f41e"},"previous_names":[],"tags_count":56,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bevry%2Fcson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bevry%2Fcson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bevry%2Fcson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bevry%2Fcson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bevry","download_url":"https://codeload.github.com/bevry/cson/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246900170,"owners_count":20852006,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["coffeescript","cson","data-format","executable","json","nodejs"],"created_at":"2024-08-02T02:01:05.157Z","updated_at":"2025-04-03T17:08:25.034Z","avatar_url":"https://github.com/bevry.png","language":"CoffeeScript","readme":"\u003c!-- TITLE/ --\u003e\n\n# CSON\n\n\u003c!-- /TITLE --\u003e\n\n\u003c!-- BADGES/ --\u003e\n\n\u003cspan class=\"badge-githubworkflow\"\u003e\u003ca href=\"https://github.com/bevry/cson/actions?query=workflow%3Abevry\" title=\"View the status of this project's GitHub Workflow: bevry\"\u003e\u003cimg src=\"https://github.com/bevry/cson/workflows/bevry/badge.svg\" alt=\"Status of the GitHub Workflow: bevry\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan class=\"badge-npmversion\"\u003e\u003ca href=\"https://npmjs.org/package/cson\" title=\"View this project on NPM\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/cson.svg\" alt=\"NPM version\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan class=\"badge-npmdownloads\"\u003e\u003ca href=\"https://npmjs.org/package/cson\" title=\"View this project on NPM\"\u003e\u003cimg src=\"https://img.shields.io/npm/dm/cson.svg\" alt=\"NPM downloads\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cbr class=\"badge-separator\" /\u003e\n\u003cspan class=\"badge-githubsponsors\"\u003e\u003ca href=\"https://github.com/sponsors/balupton\" title=\"Donate to this project using GitHub Sponsors\"\u003e\u003cimg src=\"https://img.shields.io/badge/github-donate-yellow.svg\" alt=\"GitHub Sponsors donate button\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan class=\"badge-thanksdev\"\u003e\u003ca href=\"https://thanks.dev/u/gh/bevry\" title=\"Donate to this project using ThanksDev\"\u003e\u003cimg src=\"https://img.shields.io/badge/thanksdev-donate-yellow.svg\" alt=\"ThanksDev donate button\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan class=\"badge-patreon\"\u003e\u003ca href=\"https://patreon.com/bevry\" title=\"Donate to this project using Patreon\"\u003e\u003cimg src=\"https://img.shields.io/badge/patreon-donate-yellow.svg\" alt=\"Patreon donate button\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan class=\"badge-liberapay\"\u003e\u003ca href=\"https://liberapay.com/bevry\" title=\"Donate to this project using Liberapay\"\u003e\u003cimg src=\"https://img.shields.io/badge/liberapay-donate-yellow.svg\" alt=\"Liberapay donate button\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan class=\"badge-buymeacoffee\"\u003e\u003ca href=\"https://buymeacoffee.com/balupton\" title=\"Donate to this project using Buy Me A Coffee\"\u003e\u003cimg src=\"https://img.shields.io/badge/buy%20me%20a%20coffee-donate-yellow.svg\" alt=\"Buy Me A Coffee donate button\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan class=\"badge-opencollective\"\u003e\u003ca href=\"https://opencollective.com/bevry\" title=\"Donate to this project using Open Collective\"\u003e\u003cimg src=\"https://img.shields.io/badge/open%20collective-donate-yellow.svg\" alt=\"Open Collective donate button\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan class=\"badge-crypto\"\u003e\u003ca href=\"https://bevry.me/crypto\" title=\"Donate to this project using Cryptocurrency\"\u003e\u003cimg src=\"https://img.shields.io/badge/crypto-donate-yellow.svg\" alt=\"crypto donate button\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan class=\"badge-paypal\"\u003e\u003ca href=\"https://bevry.me/paypal\" title=\"Donate to this project using Paypal\"\u003e\u003cimg src=\"https://img.shields.io/badge/paypal-donate-yellow.svg\" alt=\"PayPal donate button\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cbr class=\"badge-separator\" /\u003e\n\u003cspan class=\"badge-discord\"\u003e\u003ca href=\"https://discord.gg/nQuXddV7VP\" title=\"Join this project's community on Discord\"\u003e\u003cimg src=\"https://img.shields.io/discord/1147436445783560193?logo=discord\u0026amp;label=discord\" alt=\"Discord server badge\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan class=\"badge-twitch\"\u003e\u003ca href=\"https://www.twitch.tv/balupton\" title=\"Join this project's community on Twitch\"\u003e\u003cimg src=\"https://img.shields.io/twitch/status/balupton?logo=twitch\" alt=\"Twitch community badge\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\n\u003c!-- /BADGES --\u003e\n\n\nCoffeeScript-Object-Notation. Same as JSON but for CoffeeScript objects.\n\n[Projects using CSON.](https://www.npmjs.org/browse/depended/cson)\n\n[Projects using CSON Parser directly.](https://www.npmjs.org/browse/depended/cson-parser)\n\nSince v2, this CSON package is a higher-level wrapper around the lower-level [CSON Parser](https://www.npmjs.com/package/cson-parser).\n\n\n\n\n\n## What is CSON?\n\nEveryone knows JSON, it's the thing that looks like this:\n\n``` javascript\n{\n  \"greatDocumentaries\": [\n    \"earthlings.com\",\n    \"forksoverknives.com\",\n    \"cowspiracy.com\"\n  ],\n  \"importantFacts\": {\n    \"emissions\": \"Livestock and their byproducts account for at least 32,000 million tons of carbon dioxide (CO2) per year, or 51% of all worldwide greenhouse gas emissions.\\nGoodland, R Anhang, J. “Livestock and Climate Change: What if the key actors in climate change were pigs, chickens and cows?”\\nWorldWatch, November/December 2009. Worldwatch Institute, Washington, DC, USA. Pp. 10–19.\\nhttp://www.worldwatch.org/node/6294\",\n    \"landuse\": \"Livestock covers 45% of the earth’s total land.\\nThornton, Phillip, Mario Herrero, and Polly Ericksen. “Livestock and Climate Change.” Livestock Exchange, no. 3 (2011).\\nhttps://cgspace.cgiar.org/bitstream/handle/10568/10601/IssueBrief3.pdf\",\n    \"burger\": \"One hamburger requires 660 gallons of water to produce – the equivalent of 2 months’ worth of showers.\\nCatanese, Christina. “Virtual Water, Real Impacts.” Greenversations: Official Blog of the U.S. EPA. 2012.\\nhttp://blog.epa.gov/healthywaters/2012/03/virtual-water-real-impacts-world-water-day-2012/\\n“50 Ways to Save Your River.” Friends of the River.\\nhttp://www.friendsoftheriver.org/site/PageServer?pagename=50ways\",\n    \"milk\": \"1,000 gallons of water are required to produce 1 gallon of milk.\\n“Water trivia facts.” United States Environmental Protection Agency.\\nhttp://water.epa.gov/learn/kids/drinkingwater/water_trivia_facts.cfm#_edn11\",\n    \"more\": \"http://cowspiracy.com/facts\"\n  }\n}\n```\n\nNow let's write the same thing in CSON:\n\n``` coffeescript\n# Comments!!!\n\n# An Array with no commas!\ngreatDocumentaries: [\n\t'earthlings.com'\n\t'forksoverknives.com'\n\t'cowspiracy.com'\n]\n\n# An Object without braces!\nimportantFacts:\n\t# Multi-Line Strings! Without Quote Escaping!\n\temissions: '''\n\t\tLivestock and their byproducts account for at least 32,000 million tons of carbon dioxide (CO2) per year, or 51% of all worldwide greenhouse gas emissions.\n\t\tGoodland, R Anhang, J. “Livestock and Climate Change: What if the key actors in climate change were pigs, chickens and cows?”\n\t\tWorldWatch, November/December 2009. Worldwatch Institute, Washington, DC, USA. Pp. 10–19.\n\t\thttp://www.worldwatch.org/node/6294\n\t\t'''\n\n\tlanduse: '''\n\t\tLivestock covers 45% of the earth’s total land.\n\t\tThornton, Phillip, Mario Herrero, and Polly Ericksen. “Livestock and Climate Change.” Livestock Exchange, no. 3 (2011).\n\t\thttps://cgspace.cgiar.org/bitstream/handle/10568/10601/IssueBrief3.pdf\n\t\t'''\n\n\tburger: '''\n\t\tOne hamburger requires 660 gallons of water to produce – the equivalent of 2 months’ worth of showers.\n\t\tCatanese, Christina. “Virtual Water, Real Impacts.” Greenversations: Official Blog of the U.S. EPA. 2012.\n\t\thttp://blog.epa.gov/healthywaters/2012/03/virtual-water-real-impacts-world-water-day-2012/\n\t\t“50 Ways to Save Your River.” Friends of the River.\n\t\thttp://www.friendsoftheriver.org/site/PageServer?pagename=50ways\n\t\t'''\n\n\tmilk: '''\n\t\t1,000 gallons of water are required to produce 1 gallon of milk.\n\t\t“Water trivia facts.” United States Environmental Protection Agency.\n\t\thttp://water.epa.gov/learn/kids/drinkingwater/water_trivia_facts.cfm#_edn11\n\t\t'''\n\n\tmore: 'http://cowspiracy.com/facts'\n```\n\nWhich is far more lenient than JSON, way nicer to write and read, no need to quote and escape everything, has comments and readable multi-line strings, and won't fail if you forget a comma.\n\n\n\n## Using CSON\n\n### Via the Command Line\n\nUse CSON with the command line with:\n\n``` bash\n# Convert a JSON file into a CSON file\njson2cson in.json \u003e out.cson\n# Same thing via piping\ncat in.json | json2cson \u003e out.cson\n\n# Convert a CSON file into a JSON file\ncson2json in.cson \u003e out.json\n# Same thing via piping\ncat in.cson | cson2json \u003e out.json\n```\n\nRequires a global CSON install: `npm install -g cson`\n\n\n### Via the API\n\nInclude CSON:\n\n``` javascript\nvar CSON = require('cson')\n```\n\nEach method can be executed without a callback like so:\n\n``` javascript\nvar result = CSON.createCSONString({a:{b:'c'}}, {/* optional options argument */})\nif ( result instanceof Error ) {\n\tconsole.log(result.stack)\n} else {\n\tconsole.log(result)\n}\n```\n\nOr via a callback like so:\n\n``` javascript\nCSON.createCSONString({a:{b:'c'}}, {/* optional options argument */}, function(err,result){\n\tconsole.log(err, result)\n})\n```\n\nExecuting the method with a callback still executes the method synchronously.\n\nClick the below function names to open more detailed documentation.\n\n\n#### Create Strings\n\n- \u003ca href='http://master.cson.bevry.surge.sh/docs/classes/CSON.html#stringify-instance'\u003eString \u003cstrong\u003eCSON.stringify\u003c/strong\u003e(data, replacer?, indent?)\u003c/a\u003e \u003cbr/\u003e Converts an \u003ca href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object'\u003eObject\u003c/a\u003e into a CSON \u003ca href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String'\u003eString\u003c/a\u003e\n\n- \u003ca href='http://master.cson.bevry.surge.sh/docs/classes/CSON.html#createCSONString-instance'\u003eString \u003cstrong\u003eCSON.createCSONString\u003c/strong\u003e(data, opts?, next?)\u003c/a\u003e \u003cbr/\u003e Converts an \u003ca href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object'\u003eObject\u003c/a\u003e into a CSON \u003ca href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String'\u003eString\u003c/a\u003e\n\n- \u003ca href='http://master.cson.bevry.surge.sh/docs/classes/CSON.html#createJSONString-instance'\u003eString \u003cstrong\u003eCSON.createJSONString\u003c/strong\u003e(data, opts?, next?)\u003c/a\u003e \u003cbr/\u003e Converts an \u003ca href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object'\u003eObject\u003c/a\u003e into a JSON \u003ca href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String'\u003eString\u003c/a\u003e\n\n- \u003ca href='http://master.cson.bevry.surge.sh/docs/classes/CSON.html#createString-instance'\u003eString \u003cstrong\u003eCSON.createString\u003c/strong\u003e(data, opts?, next?)\u003c/a\u003e \u003cbr/\u003e Converts an \u003ca href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object'\u003eObject\u003c/a\u003e into a \u003ca href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String'\u003eString\u003c/a\u003e of the desired format If the format option is not specified, we default to CSON\n\n\n### Parse Strings\n\n- \u003ca href='http://master.cson.bevry.surge.sh/docs/classes/CSON.html#parse-instance'\u003eObject \u003cstrong\u003eCSON.parse\u003c/strong\u003e(data, opts?, next?)\u003c/a\u003e \u003cbr/\u003e Parses a CSON \u003ca href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String'\u003eString\u003c/a\u003e into an \u003ca href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object'\u003eObject\u003c/a\u003e\n\n- \u003ca href='http://master.cson.bevry.surge.sh/docs/classes/CSON.html#parseCSONString-instance'\u003eObject \u003cstrong\u003eCSON.parseCSONString\u003c/strong\u003e(data, opts?, next?)\u003c/a\u003e \u003cbr/\u003e Parses a CSON \u003ca href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String'\u003eString\u003c/a\u003e into an \u003ca href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object'\u003eObject\u003c/a\u003e\n\n- \u003ca href='http://master.cson.bevry.surge.sh/docs/classes/CSON.html#parseJSONString-instance'\u003eObject \u003cstrong\u003eCSON.parseJSONString\u003c/strong\u003e(data, opts?, next?)\u003c/a\u003e \u003cbr/\u003e Parses a JSON \u003ca href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String'\u003eString\u003c/a\u003e into an \u003ca href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object'\u003eObject\u003c/a\u003e\n\n- \u003ca href='http://master.cson.bevry.surge.sh/docs/classes/CSON.html#parseCSString-instance'\u003eObject \u003cstrong\u003eCSON.parseCSString\u003c/strong\u003e(data, opts?, next?)\u003c/a\u003e \u003cbr/\u003e Parses a CoffeeScript \u003ca href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String'\u003eString\u003c/a\u003e into an \u003ca href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object'\u003eObject\u003c/a\u003e\n\n- \u003ca href='http://master.cson.bevry.surge.sh/docs/classes/CSON.html#parseJSString-instance'\u003eObject \u003cstrong\u003eCSON.parseJSString\u003c/strong\u003e(data, opts?, next?)\u003c/a\u003e \u003cbr/\u003e Parses a JavaScript \u003ca href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String'\u003eString\u003c/a\u003e into an \u003ca href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object'\u003eObject\u003c/a\u003e\n\n- \u003ca href='http://master.cson.bevry.surge.sh/docs/classes/CSON.html#parseString-instance'\u003eObject \u003cstrong\u003eCSON.parseString\u003c/strong\u003e(data, opts?, next?)\u003c/a\u003e \u003cbr/\u003e Converts a \u003ca href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String'\u003eString\u003c/a\u003e of the desired format into an \u003ca href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object'\u003eObject\u003c/a\u003e If the format option is not specified, we default to CSON\n\n\n#### Parse Files\n\n- \u003ca href='http://master.cson.bevry.surge.sh/docs/classes/CSON.html#load-instance'\u003eObject \u003cstrong\u003eCSON.load\u003c/strong\u003e(filePath, opts?, next?)\u003c/a\u003e \u003cbr/\u003e Parses a CSON file into an \u003ca href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object'\u003eObject\u003c/a\u003e\n\n- \u003ca href='http://master.cson.bevry.surge.sh/docs/classes/CSON.html#parseCSONFile-instance'\u003eObject \u003cstrong\u003eCSON.parseCSONFile\u003c/strong\u003e(filePath, opts?, next?)\u003c/a\u003e \u003cbr/\u003e Parses a CSON file into an \u003ca href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object'\u003eObject\u003c/a\u003e\n\n- \u003ca href='http://master.cson.bevry.surge.sh/docs/classes/CSON.html#parseJSONFile-instance'\u003eObject \u003cstrong\u003eCSON.parseJSONFile\u003c/strong\u003e(filePath, opts?, next?)\u003c/a\u003e \u003cbr/\u003e Parses a JSON file into an \u003ca href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object'\u003eObject\u003c/a\u003e\n\n- \u003ca href='http://master.cson.bevry.surge.sh/docs/classes/CSON.html#parseCSFile-instance'\u003eObject \u003cstrong\u003eCSON.parseCSFile\u003c/strong\u003e(filePath, opts?, next?)\u003c/a\u003e \u003cbr/\u003e Parses a CoffeeScript file into an \u003ca href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object'\u003eObject\u003c/a\u003e\n\n- \u003ca href='http://master.cson.bevry.surge.sh/docs/classes/CSON.html#parseJSFile-instance'\u003eObject \u003cstrong\u003eCSON.parseJSFile\u003c/strong\u003e(filePath, opts?, next?)\u003c/a\u003e \u003cbr/\u003e Parses a JavaScript file into an \u003ca href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object'\u003eObject\u003c/a\u003e\n\n- \u003ca href='http://master.cson.bevry.surge.sh/docs/classes/CSON.html#parseFile-instance'\u003eObject \u003cstrong\u003eCSON.parseFile\u003c/strong\u003e(filePath, opts?, next?)\u003c/a\u003e \u003cbr/\u003e Parses a file path of the desired format into an \u003ca href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object'\u003eObject\u003c/a\u003e If the format option is not specified, we use the filename to detect what it should be, otherwise we default to CSON\n\n\n### Require Files\n\n- \u003ca href='http://master.cson.bevry.surge.sh/docs/classes/CSON.html#requireCSFile-instance'\u003eObject \u003cstrong\u003eCSON.requireCSFile\u003c/strong\u003e(filePath, opts?, next?)\u003c/a\u003e \u003cbr/\u003e Requires a CoffeeScript file and returns the result \u003ca href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object'\u003eObject\u003c/a\u003e\n\n- \u003ca href='http://master.cson.bevry.surge.sh/docs/classes/CSON.html#requireJSFile-instance'\u003eObject \u003cstrong\u003eCSON.requireJSFile\u003c/strong\u003e(filePath, opts?, next?)\u003c/a\u003e \u003cbr/\u003e Requires a JavaScript file and returns the result \u003ca href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object'\u003eObject\u003c/a\u003e\n\n- \u003ca href='http://master.cson.bevry.surge.sh/docs/classes/CSON.html#requireFile-instance'\u003eObject \u003cstrong\u003eCSON.requireFile\u003c/strong\u003e(filePath, opts?, next?)\u003c/a\u003e \u003cbr/\u003e Requires or parses a file path of the desired format into an \u003ca href='https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object'\u003eObject\u003c/a\u003e If the format option is not specified, we use the filename to detect what it should be, otherwise we default to parsing CSON\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\u003c!-- INSTALL/ --\u003e\n\n## Install\n\n### [npm](https://npmjs.com \"npm is a package manager for javascript\")\n\n#### Install Globally\n\n-   Install: `npm install --global cson`\n-   Executables: `cson`, `cson2json`, `json2cson`\n\n#### Install Locally\n\n-   Install: `npm install --save cson`\n-   Executables: `npx cson`, `npx cson2json`, `npx json2cson`\n-   Import: `import * as pkg from ('cson')`\n-   Require: `const pkg = require('cson')`\n\n### [Editions](https://editions.bevry.me \"Editions are the best way to produce and consume packages you care about.\")\n\nThis package is published with the following editions:\n-   `cson/source/index.coffee` is [CoffeeScript](https://coffeescript.org \"CoffeeScript is a little language that compiles into JavaScript\") source code with [Require](https://nodejs.org/dist/latest-v5.x/docs/api/modules.html \"Node/CJS Modules\") for modules\n-   `cson` aliases `cson/edition-esnext/index.js`\n-   `cson/edition-esnext/index.js` is [CoffeeScript](https://coffeescript.org \"CoffeeScript is a little language that compiles into JavaScript\") compiled for [Node.js](https://nodejs.org \"Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine\") 6 || 8 || 10 || 12 || 14 || 16 || 18 || 20 || 21 with [Require](https://nodejs.org/dist/latest-v5.x/docs/api/modules.html \"Node/CJS Modules\") for modules\n\n\u003c!-- /INSTALL --\u003e\n\n\u003c!-- HISTORY/ --\u003e\n\n## History\n\n[Discover the release history by heading on over to the `HISTORY.md` file.](https://github.com/bevry/cson/blob/HEAD/HISTORY.md#files)\n\n\u003c!-- /HISTORY --\u003e\n\n\u003c!-- BACKERS/ --\u003e\n\n## Backers\n\n### Code\n\n[Discover how to contribute via the `CONTRIBUTING.md` file.](https://github.com/bevry/cson/blob/HEAD/CONTRIBUTING.md#files)\n\n#### Authors\n\n-   [Benjamin Lupton](https://balupton.com) — Accelerating collaborative wisdom.\n\n#### Maintainers\n\n-   [Benjamin Lupton](https://balupton.com) — Accelerating collaborative wisdom.\n\n#### Contributors\n\n-   [Attila Oláh](https://github.com/attilaolah) — [view contributions](https://github.com/bevry/cson/commits?author=attilaolah \"View the GitHub contributions of Attila Oláh on repository bevry/cson\")\n-   [Attila Oláh](https://attilaolah.eu)\n-   [Benjamin Lupton](https://github.com/balupton) — [view contributions](https://github.com/bevry/cson/commits?author=balupton \"View the GitHub contributions of Benjamin Lupton on repository bevry/cson\")\n-   [Claudius Nicolae](https://github.com/clyfe) — [view contributions](https://github.com/bevry/cson/commits?author=clyfe \"View the GitHub contributions of Claudius Nicolae on repository bevry/cson\")\n-   [evinugur](https://github.com/evinugur) — [view contributions](https://github.com/bevry/cson/commits?author=evinugur \"View the GitHub contributions of evinugur on repository bevry/cson\")\n-   [Jason Karns](https://github.com/jasonkarns) — [view contributions](https://github.com/bevry/cson/commits?author=jasonkarns \"View the GitHub contributions of Jason Karns on repository bevry/cson\")\n-   [Joël Perras](https://github.com/jperras) — [view contributions](https://github.com/bevry/cson/commits?author=jperras \"View the GitHub contributions of Joël Perras on repository bevry/cson\")\n-   [Linus G Thiel](https://github.com/linus) — [view contributions](https://github.com/bevry/cson/commits?author=linus \"View the GitHub contributions of Linus G Thiel on repository bevry/cson\")\n-   [Rob Loach](https://github.com/RobLoach) — [view contributions](https://github.com/bevry/cson/commits?author=RobLoach \"View the GitHub contributions of Rob Loach on repository bevry/cson\")\n-   [Ryan LeFevre](https://github.com/meltingice) — [view contributions](https://github.com/bevry/cson/commits?author=meltingice \"View the GitHub contributions of Ryan LeFevre on repository bevry/cson\")\n-   [Tushar Kant](https://github.com/nanuclickity) — [view contributions](https://github.com/bevry/cson/commits?author=nanuclickity \"View the GitHub contributions of Tushar Kant on repository bevry/cson\")\n-   [Zearin](https://github.com/Zearin) — [view contributions](https://github.com/bevry/cson/commits?author=Zearin \"View the GitHub contributions of Zearin on repository bevry/cson\")\n-   [ZHANG Cheng](https://github.com/zhangcheng) — [view contributions](https://github.com/bevry/cson/commits?author=zhangcheng \"View the GitHub contributions of ZHANG Cheng on repository bevry/cson\")\n\n### Finances\n\n\u003cspan class=\"badge-githubsponsors\"\u003e\u003ca href=\"https://github.com/sponsors/balupton\" title=\"Donate to this project using GitHub Sponsors\"\u003e\u003cimg src=\"https://img.shields.io/badge/github-donate-yellow.svg\" alt=\"GitHub Sponsors donate button\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan class=\"badge-thanksdev\"\u003e\u003ca href=\"https://thanks.dev/u/gh/bevry\" title=\"Donate to this project using ThanksDev\"\u003e\u003cimg src=\"https://img.shields.io/badge/thanksdev-donate-yellow.svg\" alt=\"ThanksDev donate button\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan class=\"badge-patreon\"\u003e\u003ca href=\"https://patreon.com/bevry\" title=\"Donate to this project using Patreon\"\u003e\u003cimg src=\"https://img.shields.io/badge/patreon-donate-yellow.svg\" alt=\"Patreon donate button\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan class=\"badge-liberapay\"\u003e\u003ca href=\"https://liberapay.com/bevry\" title=\"Donate to this project using Liberapay\"\u003e\u003cimg src=\"https://img.shields.io/badge/liberapay-donate-yellow.svg\" alt=\"Liberapay donate button\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan class=\"badge-buymeacoffee\"\u003e\u003ca href=\"https://buymeacoffee.com/balupton\" title=\"Donate to this project using Buy Me A Coffee\"\u003e\u003cimg src=\"https://img.shields.io/badge/buy%20me%20a%20coffee-donate-yellow.svg\" alt=\"Buy Me A Coffee donate button\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan class=\"badge-opencollective\"\u003e\u003ca href=\"https://opencollective.com/bevry\" title=\"Donate to this project using Open Collective\"\u003e\u003cimg src=\"https://img.shields.io/badge/open%20collective-donate-yellow.svg\" alt=\"Open Collective donate button\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan class=\"badge-crypto\"\u003e\u003ca href=\"https://bevry.me/crypto\" title=\"Donate to this project using Cryptocurrency\"\u003e\u003cimg src=\"https://img.shields.io/badge/crypto-donate-yellow.svg\" alt=\"crypto donate button\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\u003cspan class=\"badge-paypal\"\u003e\u003ca href=\"https://bevry.me/paypal\" title=\"Donate to this project using Paypal\"\u003e\u003cimg src=\"https://img.shields.io/badge/paypal-donate-yellow.svg\" alt=\"PayPal donate button\" /\u003e\u003c/a\u003e\u003c/span\u003e\n\n#### Sponsors\n\n-   [Andrew Nesbitt](https://nesbitt.io) — Software engineer and researcher\n-   [Balsa](https://balsa.com) — We're Balsa, and we're building tools for builders.\n-   [Codecov](https://codecov.io) — Empower developers with tools to improve code quality and testing.\n-   [Poonacha Medappa](https://poonachamedappa.com)\n-   [Rob Morris](https://github.com/Rob-Morris)\n-   [Sentry](https://sentry.io) — Real-time crash reporting for your web apps, mobile apps, and games.\n-   [Syntax](https://syntax.fm) — Syntax Podcast\n\n#### Donors\n\n-   [Andrew Nesbitt](https://nesbitt.io)\n-   [Armen Mkrtchian](https://mogoni.dev)\n-   [Balsa](https://balsa.com)\n-   [Chad](https://opencollective.com/chad8)\n-   [Codecov](https://codecov.io)\n-   [dr.dimitru](https://veliovgroup.com)\n-   [Elliott Ditman](https://elliottditman.com)\n-   [entroniq](https://gitlab.com/entroniq)\n-   [GitHub](https://github.com/about)\n-   [Hunter Beast](https://cryptoquick.com)\n-   [Jean-Luc Geering](https://github.com/jlgeering)\n-   [Michael Duane Mooring](https://mdm.cc)\n-   [Michael Harry Scepaniak](https://michaelscepaniak.com)\n-   [Mohammed Shah](https://github.com/smashah)\n-   [Mr. Henry](https://mrhenry.be)\n-   [Nermal](https://arjunaditya.vercel.app)\n-   [Pleo](https://pleo.io)\n-   [Poonacha Medappa](https://poonachamedappa.com)\n-   [Rob Morris](https://github.com/Rob-Morris)\n-   [Robert de Forest](https://github.com/rdeforest)\n-   [Sentry](https://sentry.io)\n-   [ServieJS](https://github.com/serviejs)\n-   [Skunk Team](https://skunk.team)\n-   [Syntax](https://syntax.fm)\n-   [WriterJohnBuck](https://github.com/WriterJohnBuck)\n\n\u003c!-- /BACKERS --\u003e\n\n\u003c!-- LICENSE/ --\u003e\n\n## License\n\nUnless stated otherwise all works are:\n\n-   Copyright \u0026copy; [Benjamin Lupton](https://balupton.com)\n\nand licensed under:\n\n-   [Artistic License 2.0](http://spdx.org/licenses/Artistic-2.0.html)\n\n\u003c!-- /LICENSE --\u003e\n","funding_links":["https://github.com/sponsors/balupton","https://patreon.com/bevry","https://opencollective.com/bevry","https://ko-fi.com/balupton","https://liberapay.com/bevry","https://tidelift.com/funding/github/npm/cson","https://bevry.me/fund","https://thanks.dev/u/gh/bevry","https://buymeacoffee.com/balupton","https://opencollective.com/chad8"],"categories":["Related formats","What's Next?","CoffeeScript"],"sub_categories":["CSON (II)"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbevry%2Fcson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbevry%2Fcson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbevry%2Fcson/lists"}