{"id":21658731,"url":"https://github.com/BinaryMuse/toml-node","last_synced_at":"2025-07-17T21:31:30.612Z","repository":{"id":7094930,"uuid":"8386256","full_name":"BinaryMuse/toml-node","owner":"BinaryMuse","description":"TOML parser for Node.js and the Browser. Parses TOML v0.4.0","archived":false,"fork":false,"pushed_at":"2022-01-14T19:44:41.000Z","size":362,"stargazers_count":304,"open_issues_count":20,"forks_count":25,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-11-21T09:10:31.619Z","etag":null,"topics":["javascript","nodejs","toml","toml-parser"],"latest_commit_sha":null,"homepage":"http://binarymuse.github.io/toml-node/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BinaryMuse.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-02-24T04:18:21.000Z","updated_at":"2024-11-11T05:50:53.000Z","dependencies_parsed_at":"2022-09-16T18:11:23.669Z","dependency_job_id":null,"html_url":"https://github.com/BinaryMuse/toml-node","commit_stats":null,"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BinaryMuse%2Ftoml-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BinaryMuse%2Ftoml-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BinaryMuse%2Ftoml-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BinaryMuse%2Ftoml-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BinaryMuse","download_url":"https://codeload.github.com/BinaryMuse/toml-node/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226304967,"owners_count":17603720,"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":["javascript","nodejs","toml","toml-parser"],"created_at":"2024-11-25T09:29:44.300Z","updated_at":"2024-11-25T09:30:01.301Z","avatar_url":"https://github.com/BinaryMuse.png","language":"JavaScript","readme":"TOML Parser for Node.js\n=======================\n\n[![Build Status](https://travis-ci.org/BinaryMuse/toml-node.png?branch=master)](https://travis-ci.org/BinaryMuse/toml-node)\n\n[![NPM](https://nodei.co/npm/toml.png?downloads=true)](https://nodei.co/npm/toml/)\n\nIf you haven't heard of TOML, well you're just missing out. [Go check it out now.](https://github.com/mojombo/toml) Back? Good.\n\nTOML Spec Support\n-----------------\n\ntoml-node supports version 0.4.0 the TOML spec as specified by [mojombo/toml@v0.4.0](https://github.com/mojombo/toml/blob/master/versions/en/toml-v0.4.0.md)\n\nInstallation\n------------\n\ntoml-node is available via npm.\n\n    npm install toml\n\ntoml-node also works with browser module bundlers like Browserify and webpack.\n\nUsage\n-----\n\n### Standalone\n\nSay you have some awesome TOML in a variable called `someTomlString`. Maybe it came from the web; maybe it came from a file; wherever it came from, it came asynchronously! Let's turn that sucker into a JavaScript object.\n\n```javascript\nvar toml = require('toml');\nvar data = toml.parse(someTomlString);\nconsole.dir(data);\n```\n\n`toml.parse` throws an exception in the case of a parsing error; such exceptions have a `line` and `column` property on them to help identify the offending text.\n\n```javascript\ntry {\n  toml.parse(someCrazyKnuckleHeadedTrblToml);\n} catch (e) {\n  console.error(\"Parsing error on line \" + e.line + \", column \" + e.column +\n    \": \" + e.message);\n}\n```\n\n### Streaming\n\nAs of toml-node version 1.0, the streaming interface has been removed. Instead, use a module like [concat-stream](https://npmjs.org/package/concat-stream):\n\n```javascript\nvar toml = require('toml');\nvar concat = require('concat-stream');\nvar fs = require('fs');\n\nfs.createReadStream('tomlFile.toml', 'utf8').pipe(concat(function(data) {\n  var parsed = toml.parse(data);\n}));\n```\n\nThanks [@ForbesLindesay](https://github.com/ForbesLindesay) for the suggestion.\n\n### Requiring with Node.js\n\nYou can use the [toml-require package](https://github.com/BinaryMuse/toml-require) to `require()` your `.toml` files with Node.js\n\nLive Demo\n---------\n\nYou can experiment with TOML online at http://binarymuse.github.io/toml-node/, which uses the latest version of this library.\n\nBuilding \u0026 Testing\n------------------\n\ntoml-node uses [the PEG.js parser generator](http://pegjs.majda.cz/).\n\n    npm install\n    npm run build\n    npm test\n\nAny changes to `src/toml.peg` requires a regeneration of the parser with `npm run build`.\n\ntoml-node is tested on Travis CI and is tested against:\n\n * Node 0.10\n * Node 0.12\n * Latest stable io.js\n\nLicense\n-------\n\ntoml-node is licensed under the MIT license agreement. See the LICENSE file for more information.\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBinaryMuse%2Ftoml-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FBinaryMuse%2Ftoml-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBinaryMuse%2Ftoml-node/lists"}