{"_id":"smol-toml@1.9.0","bugs":"https://github.com/squirrelchat/smol-toml/issues","dist":{"shasum":"f36b8dc7eb621c541c48f9fba6925dab95172817","tarball":"http://registry-npm.ywwl.com/smol-toml/download/smol-toml-1.9.0.tgz","integrity":"sha512-hpd+HLON7HdZXqYchMM/+LaTTbdK0AU3NngIJ4KVyWbY9bfQqdL9cD+4yf6dUoU2Ap4VsU0JkQi6FxAI1B2mXQ==","fileCount":19,"unpackedSize":139963,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/smol-toml@1.9.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIBi2gQGBqUEkf23V+d7JKMjxUDF6PNwakAjulpTgBKuYAiEA9hSvB8/pl3pmnOEOTSN67jpvi54SBbEHUDkCUVy3Zy8="}],"size":31492,"noattachment":false,"key":"/smol-toml/-/smol-toml-1.9.0.tgz"},"main":"./dist/index.cjs","name":"smol-toml","type":"module","types":"./dist/index.d.ts","author":"Cynthia Rey <cynthia@cynthia.dev>","module":"./dist/index.js","engines":{"node":">= 18"},"exports":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"funding":"https://github.com/sponsors/cyyynthia","license":"BSD-3-Clause","scripts":{"test":"vitest","update-gha":"pin-github-action .github/workflows"},"version":"1.9.0","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:484885fd-235a-4a12-a338-2c8ce052686f"},"approver":{"name":"cyyynthia","email":"cynthia@cynthia.dev"}},"keywords":["parser","serializer","toml"],"devEngines":{"runtime":{"name":"node","onFail":"warn","version":"^26"},"packageManager":{"name":"pnpm","onFail":"error","version":"12.5.1"}},"repository":{"url":"github:squirrelchat/smol-toml","type":"git"},"description":"A small, fast, and correct TOML parser/serializer","directories":{},"maintainers":[{"name":"cyyynthia","email":"cynthia@cynthia.dev"}],"publishConfig":{"access":"public","provenance":true},"devDependencies":{"vite":"^8.3.0","mitata":"^1.0.34","vitest":"^5.0.1","rolldown":"^1.2.9","typescript":"^7.0.2","@types/node":"^26.6.2","@mitata/counters":"^0.0.8","@tsconfig/node-ts":"^23.6.4","pin-github-action":"^3.5.2","@tsconfig/node-lts":"^24.0.1","@tsconfig/strictest":"^2.0.8"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/smol-toml_1.9.0_1790097334677_0.9444029037910788"},"_hasShrinkwrap":false,"readme":"# smol-toml\n[![TOML 1.1.0](https://img.shields.io/badge/TOML-1.1.0-9c4221?style=flat-square)](https://toml.io/en/v1.1.0)\n[![License](https://img.shields.io/github/license/squirrelchat/smol-toml.svg?style=flat-square)](https://github.com/squirrelchat/smol-toml/blob/mistress/LICENSE)\n[![npm](https://img.shields.io/npm/v/smol-toml?style=flat-square)](https://npmx.dev/smol-toml)\n[![Build](https://img.shields.io/github/actions/workflow/status/squirrelchat/smol-toml/build.yaml?style=flat-square&logo=github)](https://github.com/squirrelchat/smol-toml/actions/workflows/build.yaml)\n\n[![GitHub Sponsors](https://img.shields.io/badge/GitHub%20Sponsors-support%20me-EA4AAA?style=flat-square)](https://github.com/sponsors/cyyynthia)\n[![Weekly downloads](https://img.shields.io/npm/dw/smol-toml?style=flat-square)](https://npmx.dev/smol-toml)\n[![Monthly downloads](https://img.shields.io/npm/dm/smol-toml?style=flat-square)](https://npmx.dev/smol-toml)\n\nA small, fast, and correct TOML parser and serializer. smol-toml is fully spec-compliant with TOML v1.1.0, passing\nall[^toml-test-asterisk] tests from the [official `toml-test` suite](https://github.com/toml-lang/toml-test).\n\n[^toml-test-asterisk]: By default, certain invalid datetimes (e.g. `2020-02-30`) are gracefully accepted. Due to\nJavaScript's lax handling of Unicode, some invalid byte sequences are accepted. Requires using the `integersAsBigInt`\noption for full type preservation. Use the `run-toml-test.bash` script to run the tests.\n\n> [!IMPORTANT]\n> - By default, the behaviour regarding integers doesn't preserve type information, nor does it allow deserializing\n>   integers larger than 53 bits. See [Integers](#integers).\n> - The library currently uses the legacy `Date` object by default. See [Date, Time, and Datetime](#date-time-and-datetime).\n\n## Usage\n\n```js\nimport { parse, stringify } from 'smol-toml'\n\nconst doc = '...'\nconst parsed = parse(doc)\nconsole.log(parsed)\n\nconst toml = stringify(parsed)\nconsole.log(toml)\n```\n\nAlternatively, if you prefer something similar to the JSON global, you can import the library as follows\n```js\nimport * as TOML from 'smol-toml'\n\nTOML.stringify({ ... })\n```\n\nA few notes on the `stringify` function:\n- `undefined` and `null` values on objects are ignored (they do not produce a key/value).\n- `undefined` and `null` values in arrays are **rejected**.\n- Functions, classes and symbols are **rejected**.\n- By default, floats will be serialized as integers if they don't have a decimal part.\n  - i.e. `stringify(parse('a = 1.0'))` will produce `a = 1`, despite the source value being a float.\n  - See [Integers](#integers) for end-to-end type preservation using `BigInt`.\n- JS `Date` will be serialized as an Offset Date-Time in UTC.\n  - Use the [Temporal API] for representing other types (or alternatively the legacy [`TomlDate` object](#tomldate-object)).\n\n### Options\n\nBoth `parse` and `stringify` accept an options object as 2nd argument.\n\n#### Parse options\n\n| Option               | Type                          | Default  | Description                                                                                                     | Introduced in |\n|----------------------|-------------------------------|----------|-----------------------------------------------------------------------------------------------------------------|---------------|\n| `integersAsBigInt`   | `boolean \\| 'asNeeded'`       | `false`  | Parse integers as `BigInt`. See [Integers](#integers).                                                          | 1.4.0         |\n| `useLegacyDate`      | `boolean`                     | `true`   | Use the legacy `TomlDate` instead of the Temporal API. See [Date, Time, and Datetime](#date-time-and-datetime). | 1.9.0         |\n| `unsafeKeyBehaviour` | `'keep' \\| 'drop' \\| 'throw'` | `'keep'` | Reject potentially dangerous keys such as `__proto__` or `constructor`. See [Key safety](#key-safety).          | 1.9.0         |\n\n##### Key safety\n\nInternally, `smol-toml` is protected against prototype pollution and will correctly assign a plain property named e.g.\n`__proto__` on the object, similar to what JavaScript-native `JSON.parse` does.\n\nHowever, careless use of the object returned by the parser in your application code may lead to prototype pollution.\nThis is for instance the case in this example taken from Fastify's `secure-json-parse` helper which exists to address\nthis caveat.\n\n```js\nimport { parse } from 'smol-toml'\n\nconst a = parse('__proto__.b = 5')\nconsole.log(a.b) // ~> undefined\n\nconst b = Object.assign({}, a)\nconsole.log(b.b) // ~> 5\n```\n\nSimilarly to `secure-json-parse`, the library offers 3 modes to deal with these keys:\n- `keep` (default): preserve potentially unsafe properties and return the object as-is.\n- `drop`: silently drop potentially unsafe properties, returning the object as if the properties were not there.\n- `throw`: reject documents with potentially unsafe properties and throw a `TomlError`.\n\n#### Stringify options\n\n| Option           | Type      | Default    | Description                                                                                                                    | Introduced in |\n|------------------|-----------|------------|--------------------------------------------------------------------------------------------------------------------------------|---------------|\n| `numbersAsFloat` | `boolean` | `false`    | Always render plain numbers as floating point values. See [Type preservation](#type-preservation).                             | 1.4.0         |\n| `strictTemporal` | `boolean` | `false`    | Reject Temporal values with an IANA timezone or a calendar. See [IANA timezones and calendars](#iana-timezones-and-calendars). | 1.9.0         |\n\n## Dealing with values\n\n### Integers\n\nWhen parsing, both integers and floats are parsed as plain JavaScript numbers by default, which are double-precision\nfloating point numbers. That means that the library does not preserve type information between e.g. `1.0` and `1`, and\nthat it is not able to parse integers beyond 53 bits.\n\nWhile this is sufficient for the vast majority of use-cases, if support of larger integers is needed, it is possible\nto [enable BigInt support](#enabling-bigint).\n\nWhen serializing, numbers without a decimal part are serialized as integers (except if they're outside of the safe\nrange; i.e. they cannot be represented as a signed 53-bit integer). This is generally a good enough heuristic for most\nusages, but it is possible to leverage BigInts for [full type preservation](#type-preservation).\n\n#### Enabling BigInt\n\nTo parse integers beyond 53 bits, it's possible to tell the parser to return all integers as BigInt. This will\ntherefore preserve the type information at the cost of using a more expensive container (approx. 5% slowdown).\n\n```js\nimport { parse } from 'smol-toml'\n\nconst doc = '...'\nconst parsed = parse(doc, { integersAsBigInt: true })\n```\n\nIf you want to only use BigInt for numbers that cannot safely be represented as plain JavaScript numbers, you can pass\n`\"asNeeded\"` instead.\n\n##### Type preservation\n\nTo get end-to-end type preservation, you can tell the serializer to always treat numbers as floating point numbers.\nThen, only BigInts will be serialized as integers and numbers without a decimal part will still be serialized as float.\n\n```js\nimport { stringify } from 'smol-toml'\n\nconst obj =  { ... }\nconst toml = stringify(obj, { numbersAsFloat: true })\n```\n\n### Date, Time, and Datetime\n\n`smol-toml` can emit time-related types in 2 ways: the modern [Temporal API], or the legacy (_but currently default_)\n`Date` object, using a custom [`TomlDate` object](#tomldate-object).\n\n> [!NOTE]\n> While `TomlDate` is 2-3x faster than Temporal in microbenchmarks, the performance difference in practice on parse\n> time is insignificant (or even slower[^temporal-slow-or-fast]) for `smol-toml`. See the [benchmarks](#benchmarks).\n>\n> `TomlDate` is limited to millisecond precision and has a more lax behaviour. It gracefully accepts certain invalid\n> inputs, such as \"the 30th of February\", converting it to the 2nd (or 1st) of March. The Temporal implementation is\n> stricter and properly rejects these invalid dates.\n>\n> The next major version of the library will use Temporal by default.\n\n[^temporal-slow-or-fast]: The `Temporal` implementation dispatches more instructions to the CPU; however, it is much\n                          more friendly to the branch predictor. At the microarchitecture level, this allows the CPU\n                          to reach a higher number of _instructions per clock_, which results in a net positive\n                          performance impact. The CPU has to do _more_, but it can do it _faster_.\n\nThe different TOML types and Temporal types are mapped as described below.\n\n#### TOML type to Temporal mapping\n\n| TOML type                                                      | Temporal type              |\n|----------------------------------------------------------------|----------------------------|\n| [Offset Date-Time](https://toml.io/en/v1.1.0#offset-date-time) | [`Temporal.ZonedDateTime`] |\n| [Local Date-Time](https://toml.io/en/v1.1.0#local-date-time)   | [`Temporal.PlainDateTime`] |\n| [Local Date](https://toml.io/en/v1.1.0#local-date)             | [`Temporal.PlainDate`]     |\n| [Local Time](https://toml.io/en/v1.1.0#local-time)             | [`Temporal.PlainTime`]     |\n\n#### Temporal to TOML type mapping\n\n| Temporal type               | TOML type                                                      | Notes                                                                            |\n|-----------------------------|----------------------------------------------------------------|----------------------------------------------------------------------------------|\n| [`Temporal.Duration`]       | **Unsupported** (throws)                                       | There is an ongoing [feature request][toml-lang/toml#514] and an [active proposal][toml-lang/toml#1105]. Note that the current draft does not allow multi-part values (e.g. `1min 20sec`), making it likely that `Duration` will not always be convertible to a TOML value. |\n| [`Temporal.Instant`]        | [Offset Date-Time](https://toml.io/en/v1.1.0#offset-date-time) | Always in UTC.                                                                    |\n| [`Temporal.PlainDate`]      | [Local Date](https://toml.io/en/v1.1.0#local-date)             | Calendar info lost, [see below](#iana-timezones-and-calendars).                   |\n| [`Temporal.PlainDateTime`]  | [Local Date-Time](https://toml.io/en/v1.1.0#local-date-time)   | Calendar info lost, [see below](#iana-timezones-and-calendars).                   |\n| [`Temporal.PlainMonthDay`]  | **Unsupported** (throws)                                       |                                                                                   |\n| [`Temporal.PlainTime`]      | [Local Time](https://toml.io/en/v1.1.0#local-time)             |                                                                                   |\n| [`Temporal.PlainYearMonth`] | **Unsupported** (throws)                                       |                                                                                   |\n| [`Temporal.ZonedDateTime`]  | [Offset Date-Time](https://toml.io/en/v1.1.0#offset-date-time) | IANA timezone and calendar info lost, [see below](#iana-timezones-and-calendars). |\n\n##### IANA timezones and calendars\n\n`ZonedDateTime` objects may have 2 different types of timezone identifier attached to them: either an offset such as\n`+02:00`, or an [IANA Time Zone Identifier](https://www.iana.org/time-zones) such as `Europe/Paris`. The latter carries\ninformation about the currently observed offset in that region, daylight savings policies, and other timekeeping quirks\nsuch as leap seconds. It is a much more precise information than the offset alone. Additionally, `ZonedDateTime` allows\nkeeping track of a specific calendar to use, such as for example the *Japanese imperial era*.\n\nTOML can only represent offsets, not precise timezones nor a calendar[^tz-request]. As such, when serializing a\n`ZonedDateTime`, this information is **lost** and only the offset is preserved; effectively treating the `ZonedDateTime`\nas if it were an `Instant`. To prevent silent loss of timezone information, the `strictTemporal` option can be\nenabled to throw an error instead. Timezones that aren't simple offsets, or objects using a calendar that isn't\nthe default ISO 8601 will be rejected.\n\n[^tz-request]: There was a request to support the [RFC 9557] syntax, but it has been rejected. See [toml-lang/toml#1034].\n\n#### TomlDate object\n> [!NOTE]\n> This object is not formally deprecated yet, but it is a legacy API. It will be deprecated in v2 and removed in v3.\n\nThe object directly inherits the JavaScript `Date` object, with a handful of extra APIs for distinguishing between\ndifferent types of time components.\n\n`TomlDate` preserves the offset, whereas the native `Date` object usually normalises everything to UTC.\n\n> [!CAUTION]\n> Unlike the [Temporal API] which supports nanosecond precision, `Date` is limited to millisecond precision.\n\n```js\nimport { TomlDate } from 'smol-toml'\n\n// Offset Date Time\nconst date = new TomlDate('1979-05-27T07:32:00.000-08:00')\nconsole.log(date.isDateTime(), date.isDate(), date.isTime(), date.isLocal()) // ~> true, false, false, false\nconsole.log(date.toISOString()) // ~> 1979-05-27T07:32:00.000-08:00\n\n// Local Date Time\nconst date = new TomlDate('1979-05-27T07:32:00.000')\nconsole.log(date.isDateTime(), date.isDate(), date.isTime(), date.isLocal()) // ~> true, false, false, true\nconsole.log(date.toISOString()) // ~> 1979-05-27T07:32:00.000\n\n// Local Date\nconst date = new TomlDate('1979-05-27')\nconsole.log(date.isDateTime(), date.isDate(), date.isTime(), date.isLocal()) // ~> false, true, false, true\nconsole.log(date.toISOString()) // ~> 1979-05-27\n\n// Local Time\nconst date = new TomlDate('07:32:00')\nconsole.log(date.isDateTime(), date.isDate(), date.isTime(), date.isLocal()) // ~> false, false, true, true\nconsole.log(date.toISOString()) // ~> 07:32:00.000\n```\n\nYou can also wrap a native `Date` object and specify using different methods depending on the type of date you wish\nto represent:\n\n```js\nimport { TomlDate } from 'smol-toml'\n\nconst jsDate = new Date()\n\nconst offsetDateTime = TomlDate.wrapAsOffsetDateTime(jsDate)\nconst localDateTime = TomlDate.wrapAsLocalDateTime(jsDate)\nconst localDate = TomlDate.wrapAsLocalDate(jsDate)\nconst localTime = TomlDate.wrapAsLocalTime(jsDate)\n```\n\n## Performance\nThe benchmark is ran using [mitata](https://github.com/evanwashere/mitata). See the sources in `bench`.\n\n> [!NOTE]\n> - The output of `smol-toml` with Temporal *disabled* is used as the starting value for stringify benchmarks.\n> - The TOML generator used to create the 5MB test file can be found [here](https://gist.github.com/cyyynthia/e77c744cb6494dabe37d0182506526b9).\n\n### Results\n- [Parse, spec example](#parse-spec-example)\n- [Parse, 5MB randomly generated file](#parse-5mb-randomly-generated)\n- [Stringify, spec example](#parse-spec-example)\n- [Stringify, 5MB randomly generated file](#parse-5mb-randomly-generated)\n\n#### Parse, spec example\n\n|    | Library                                  | Performance   | Slowdown | Notes |\n|:--:|------------------------------------------|---------------|----------|-------|\n| 🥇  | smol-toml@1.9.0 (Date)                   | 2.98 µs/iter  | 1x       | |\n| 🥈  | smol-toml@1.9.0 (Temporal)               | 3.14 µs/iter  | 1.06x    | |\n| 🥉  | fast-toml@0.5.4                          | 5.13 µs/iter  | 1.72x    | Unmaintained. No handling of special floats. Bad handling of some unicode escapes. Parses `nan` as `false`. |\n| 4  | @iarna/toml@3.0.0                        | 12.66 µs/iter | 4.25x    | Unmaintained. Has defects in datetime parsing. Uses `eval`. |\n| 5  | @decimalturn/toml-patch@3.1.2 (Date)     | 19.60 µs/iter | 6.58x    | Special-purpose: designed for non-destructive document edition. |\n| 6  | @decimalturn/toml-patch@3.1.2 (Temporal) | 20.98 µs/iter | 7.04x    | Special-purpose: designed for non-destructive document edition. |\n| 7  | @std/toml@1.0.11                         | 22.81 µs/iter | 7.66x    | |\n| 8  | js-toml@2.0.1                            | 23.00 µs/iter | 7.72x    | |\n| 9  | @ltd/j-toml@1.38.0                       | 31.25 µs/iter | 10.49x   | Unmaintained. Has defects in number parsing when disabling `bigint`. |\n| 10 | toml@5.0.0 (Temporal)                    | 33.04 µs/iter | 11.09x   | |\n| 11 | toml@5.0.0 (Date/string)                 | 33.20 µs/iter | 11.15x   | |\n\n#### Parse, 5MB randomly generated file\n\n|    | Library                                  | Performance    | Slowdown | Notes |\n|:--:|------------------------------------------|----------------|----------|-------|\n| 🥇  | smol-toml@1.9.0 (Temporal)               | 45.05 ms/iter  | 1x       | |\n| 🥈  | smol-toml@1.9.0 (Date)                   | 47.71 ms/iter  | 1.06x    | |\n| 🥉  | fast-toml@0.5.4                          | 92.50 ms/iter  | 2.05x    | Unmaintained. No handling of special floats. Bad handling of some unicode escapes. Parses `nan` as `false`. |\n| 4  | @ltd/j-toml@1.38.0                       | 186.47 ms/iter | 4.14x    | Unmaintained. Has defects in number parsing when disabling `bigint`. |\n| 5  | @decimalturn/toml-patch@3.1.2 (Date)     | 207.09 ms/iter | 4.6x     | Special-purpose: designed for non-destructive document edition. |\n| 6  | @decimalturn/toml-patch@3.1.2 (Temporal) | 219.53 ms/iter | 4.87x    | Special-purpose: designed for non-destructive document edition. |\n| 7  | js-toml@2.0.1                            | 280.63 ms/iter | 6.23x    | |\n| 8  | @std/toml@1.0.11                         | 428.34 ms/iter | 9.51x    | |\n| 9  | toml@5.0.0 (Date/string)                 | 557.91 ms/iter | 12.38x   | |\n| 10 | toml@5.0.0 (Temporal)                    | 587.43 ms/iter | 13.04x   | |\n| -  | @iarna/toml@3.0.0                        | **DNF**        | **DNF**  | Unmaintained. Has defects in datetime parsing. Uses `eval`. |\n\n#### Stringify, spec example\n\n|   | Library                       | Performance   | Slowdown | Notes |\n|:-:|-------------------------------|---------------|----------|-------|\n| 🥇 | smol-toml@1.9.0               | 2.68 µs/iter  | 1x       | |\n| 🥈 | @std/toml@1.0.11              | 4.86 µs/iter  | 1.81x    | |\n| 🥉 | js-toml@2.0.1                 | 5.76 µs/iter  | 2.15x    | |\n| 4 | @iarna/toml@3.0.0             | 9.71 µs/iter  | 3.62x    | Unmaintained. |\n| 5 | @ltd/j-toml@1.38.0            | 48.15 µs/iter | 17.96x   | Unmaintained. |\n| 6 | @decimalturn/toml-patch@3.1.2 | 59.57 µs/iter | 22.22x   | Special-purpose: designed for non-destructive document edition. |\n\n#### Stringify, 5MB randomly generated file\n\n|   | Library                       | Performance    | Slowdown | Notes |\n|:-:|-------------------------------|----------------|----------|-------|\n| 🥇 | smol-toml@1.9.0               | 43.72 ms/iter  | 1x       | |\n| 🥈 | @std/toml@1.0.11              | 71.01 ms/iter  | 1.62x    | |\n| 🥉 | js-toml@2.0.1                 | 107.22 ms/iter | 2.45x    | |\n| 4 | @iarna/toml@3.0.0             | 134.59 ms/iter | 3.08x    | Unmaintained. |\n| 5 | @ltd/j-toml@1.38.0            | 383.10 ms/iter | 8.76x    | Unmaintained. |\n| 6 | @decimalturn/toml-patch@3.1.2 | 543.69 ms/iter | 12.44x   | Special-purpose: designed for non-destructive document edition. |\n\n### Detailed benchmark data\n\n<details>\n<summary>Detailed benchmark data</summary>\n\n```\nnode --expose-gc bench/parse.bench.ts\nclk: ~5.39 GHz\ncpu: AMD Ryzen 9 9950X3D 16-Core Processor\nruntime: node 26.10.0 (x64-linux)\n\nbenchmark                         avg (min … max) p75 / p99    (min … top 1%)\n------------------------------------------------- -------------------------------\n• spec document\n------------------------------------------------- -------------------------------\nsmol-toml (Date)                     2.98 µs/iter   2.93 µs  █\n                             (2.81 µs … 98.78 µs)   4.21 µs  █▂\n                          (440.00  b … 236.20 kb)  12.70 kb ▁██▃▂▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁\n                         4.46 ipc ( 99.06% cache)   16.97 branch misses\n               16.79k cycles  74.80k instructions   2.21k c-refs   20.71 c-misses\n\nsmol-toml (Temporal)                 3.14 µs/iter   3.16 µs             █\n                              (3.10 µs … 3.20 µs)   3.20 µs ▇▇ ▂       ▅█▅▂▂\n                          (  4.60 kb …   4.62 kb)   4.61 kb ██▇█▇▁▁▄▄▇▄█████▄▄▇▄▄\n                         4.47 ipc ( 99.22% cache)   12.39 branch misses\n               17.24k cycles  77.01k instructions   2.32k c-refs   18.12 c-misses\n\n@iarna/toml                         12.66 µs/iter  12.51 µs  █\n                           (12.09 µs … 104.09 µs)  16.70 µs  █\n                          (192.00  b … 454.46 kb)  24.09 kb ▄██▃▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁\n                         3.87 ipc ( 99.63% cache)   84.59 branch misses\n               70.08k cycles 271.21k instructions  11.96k c-refs   44.06 c-misses\n\n@ltd/j-toml                         31.25 µs/iter  30.76 µs   ▄██▂\n                           (29.69 µs … 851.32 µs)  34.20 µs   ████\n                          (760.00  b … 537.88 kb)  27.54 kb ▁▅████▇▃▂▁▁▂▁▂▁▁▁▁▁▁▁\n                         3.35 ipc ( 99.48% cache)  293.85 branch misses\n              172.79k cycles 578.79k instructions  31.46k c-refs  165.17 c-misses\n\nfast-toml                            5.13 µs/iter   5.10 µs   █\n                             (4.96 µs … 89.84 µs)   6.09 µs  ▃█\n                          (400.00  b … 376.82 kb)  12.63 kb ▁██▅▃▂▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁\n                         4.49 ipc ( 99.53% cache)   13.42 branch misses\n               28.68k cycles 128.90k instructions   3.91k c-refs   18.52 c-misses\n\n@std/toml                           22.81 µs/iter  22.71 µs    █\n                           (21.45 µs … 148.45 µs)  29.40 µs    █\n                          (120.00  b … 498.46 kb)  64.90 kb ▁▄▇█▂▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁\n                         3.75 ipc ( 99.54% cache)  105.52 branch misses\n              125.75k cycles 471.96k instructions  24.08k c-refs  110.15 c-misses\n\ntoml (Date/string)                  33.20 µs/iter  31.60 µs  █\n                             (30.38 µs … 3.01 ms)  51.14 µs  █\n                          (952.00  b …   1.56 mb) 108.82 kb ▆█▃▃▂▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁\n                         3.96 ipc ( 99.06% cache)  181.78 branch misses\n              177.03k cycles 700.26k instructions  30.31k c-refs  286.20 c-misses\n\ntoml (Temporal)                     33.04 µs/iter  31.76 µs █\n                            (31.47 µs … 47.08 µs)  33.37 µs █▂ ▂\n                          (  6.40 kb …   8.14 kb)   6.98 kb ██▁█▁▆▁▁▁▁▁▁▁▁▁▁▁▁▁▁▆\n                         3.94 ipc ( 99.13% cache)  176.95 branch misses\n              177.43k cycles 699.67k instructions  31.56k c-refs  274.71 c-misses\n\njs-toml                             23.00 µs/iter  21.48 µs  █\n                             (20.32 µs … 2.18 ms)  32.27 µs  █▆\n                          (  0.99 kb …   1.45 mb)  92.46 kb ▂██▃▂▂▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁\n                         4.10 ipc ( 98.16% cache)  178.29 branch misses\n              122.97k cycles 504.24k instructions  20.34k c-refs  374.28 c-misses\n\n@decimalturn/toml-patch (Date)      19.60 µs/iter  19.09 µs  █\n                           (18.53 µs … 841.76 µs)  26.77 µs  █\n                          (608.00  b … 607.52 kb)  60.02 kb ▃█▄▂▂▁▂▁▁▁▁▁▁▁▁▁▁▁▁▁▁\n                         3.54 ipc ( 99.33% cache)  104.70 branch misses\n              107.96k cycles 382.10k instructions  23.95k c-refs  160.21 c-misses\n\n@decimalturn/toml-patch (Temporal)  20.98 µs/iter  20.24 µs ██ █\n                            (20.12 µs … 29.49 µs)  20.51 µs ██▅█▅ ▅  ▅          ▅\n                          (  2.55 kb …   4.41 kb)   2.86 kb █████▁█▁▁█▁▁▁▁▁▁▁▁▁▁█\n                         3.52 ipc ( 99.29% cache)  106.72 branch misses\n              114.13k cycles 401.87k instructions  25.31k c-refs  179.37 c-misses\n\nsummary\n  smol-toml (Date)\n   1.06x faster than smol-toml (Temporal)\n   1.72x faster than fast-toml\n   4.25x faster than @iarna/toml\n   6.58x faster than @decimalturn/toml-patch (Date)\n   7.04x faster than @decimalturn/toml-patch (Temporal)\n   7.66x faster than @std/toml\n   7.72x faster than js-toml\n   10.49x faster than @ltd/j-toml\n   11.09x faster than toml (Temporal)\n   11.15x faster than toml (Date/string)\n\n• 5MB document\n------------------------------------------------- -------------------------------\nsmol-toml (Date)                    47.71 ms/iter  50.08 ms                     █\n                            (44.72 ms … 50.16 ms)  50.09 ms                     █\n                          ( 27.91 mb …  37.81 mb)  33.32 mb █▁█▁████▁▁▁▁▁▁▁▁▁▁▁██\n                         3.05 ipc ( 96.95% cache)   1.95M branch misses\n              249.63M cycles 760.48M instructions  23.70M c-refs 723.86k c-misses\n\nsmol-toml (Temporal)                45.05 ms/iter  46.17 ms  █\n                            (43.04 ms … 47.19 ms)  47.06 ms ▅█ ▅▅    ▅   ▅ ▅▅▅  ▅\n                          ( 25.17 mb …  36.61 mb)  31.28 mb ██▁██▁▁▁▁█▁▁▁█▁███▁▁█\n                         3.09 ipc ( 97.25% cache)   1.52M branch misses\n              244.27M cycles 754.78M instructions  29.60M c-refs 813.69k c-misses\n\n@iarna/toml                        error: Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z at row 5, col 45, pos 569:\n4: NfF6LuAerfn5mDPI7Cp 2qsrB4vGmJTyb5jNubOIBYYWrWlAsrw PX93S57gjb5GEhR8qOU5blDQmwfVJTA YvmJ9cE3cUZU NAJQgAbIdpZLhc4lOs4ZhMEWehhZqXCsVD1YP1vN2GEoM2WX''', 1986-05-27T18:36:13Z, -5460, \"2ZAV3fYlb23hf7r7QoftVlicWE2iuwp\", 4790.2253 ]\n5> SzeC4Me8T = [ 5928.9340, 1991-04-28 19:24:24, 7807, -782.4516, 0b1000011111, \"YvXRZKBGle9d51sqE90t8hP\" ]\n                                               ^\n6: SLMvBirT.pmpX1D.9PivpfFBo = 2010-09-29\n\n@ltd/j-toml                        186.47 ms/iter 184.10 ms     ██ █\n                          (166.25 ms … 284.21 ms) 192.51 ms ▅   ██ █    ▅ ▅  ▅  ▅\n                          ( 20.29 mb …  55.50 mb)  33.21 mb █▁▁▁██▁█▁▁▁▁█▁█▁▁█▁▁█\n                         2.38 ipc ( 97.97% cache)   3.93M branch misses\n                1.04G cycles   2.47G instructions 164.91M c-refs   3.35M c-misses\n\nfast-toml                           92.50 ms/iter  92.90 ms  █   █ █\n                           (88.55 ms … 101.67 ms)  97.51 ms ▅█   █ █▅ ▅  ▅      ▅\n                          ( 13.48 mb …  34.99 mb)  24.13 mb ██▁▁▁█▁██▁█▁▁█▁▁▁▁▁▁█\n                         2.82 ipc ( 98.12% cache)   2.40M branch misses\n              516.21M cycles   1.45G instructions  67.12M c-refs   1.26M c-misses\n\n@std/toml                          428.34 ms/iter 434.32 ms      █\n                          (410.50 ms … 446.83 ms) 442.42 ms ▅   ▅█   ▅▅  ▅▅▅ ▅  ▅\n                          (181.70 mb … 204.21 mb) 194.10 mb █▁▁▁██▁▁▁██▁▁███▁█▁▁█\n                         3.08 ipc ( 96.60% cache)   6.52M branch misses\n                2.41G cycles   7.42G instructions 243.62M c-refs   8.29M c-misses\n\ntoml (Date/string)                 557.91 ms/iter 562.12 ms              █\n                          (535.21 ms … 581.06 ms) 577.25 ms              █\n                          ( 34.09 mb …  84.96 mb)  64.32 mb █▁█▁▁█▁▁███▁▁█▁▁█▁▁▁█\n                         4.17 ipc ( 96.50% cache)   6.35M branch misses\n                3.07G cycles  12.80G instructions 237.61M c-refs   8.32M c-misses\n\ntoml (Temporal)                    587.43 ms/iter 597.17 ms █\n                          (570.22 ms … 607.53 ms) 606.15 ms █      █       █\n                          (  2.54 mb …  92.29 mb)  56.92 mb █▁▁█▁▁▁█▁▁▁▁▁███▁▁▁▁█\n                         4.08 ipc ( 96.20% cache)   6.59M branch misses\n                3.20G cycles  13.03G instructions 261.00M c-refs   9.91M c-misses\n\njs-toml                            280.63 ms/iter 305.16 ms  █\n                          (248.43 ms … 358.30 ms) 322.18 ms  █\n                          (268.55 mb … 282.47 mb) 272.11 mb ████▁█▁▁▁▁█▁▁▁▁█▁█▁▁█\n                         2.17 ipc ( 94.73% cache)   5.06M branch misses\n                1.49G cycles   3.23G instructions 127.90M c-refs   6.74M c-misses\n\n@decimalturn/toml-patch (Date)     207.09 ms/iter 212.85 ms   █\n                          (195.68 ms … 235.57 ms) 219.92 ms  ██\n                          (  5.63 mb …  47.95 mb)  28.68 mb ███▁▁▁▁▁▁▁▁██▁██▁▁▁▁█\n                         2.94 ipc ( 97.40% cache)   4.09M branch misses\n                1.13G cycles   3.33G instructions 144.65M c-refs   3.77M c-misses\n\n@decimalturn/toml-patch (Temporal) 219.53 ms/iter 217.17 ms ██\n                          (214.02 ms … 236.49 ms) 233.70 ms ███\n                          ( 11.24 mb …  56.44 mb)  25.17 mb ████▁▁▁▁▁▁▁▁▁▁█▁▁▁▁▁█\n                         2.89 ipc ( 97.08% cache)   4.38M branch misses\n                1.21G cycles   3.50G instructions 166.38M c-refs   4.86M c-misses\n\nsummary\n  smol-toml (Temporal)\n   1.06x faster than smol-toml (Date)\n   2.05x faster than fast-toml\n   4.14x faster than @ltd/j-toml\n   4.6x faster than @decimalturn/toml-patch (Date)\n   4.87x faster than @decimalturn/toml-patch (Temporal)\n   6.23x faster than js-toml\n   9.51x faster than @std/toml\n   12.38x faster than toml (Date/string)\n   13.04x faster than toml (Temporal)\n\nnode --expose-gc bench/stringify.bench.ts\nclk: ~5.38 GHz\ncpu: AMD Ryzen 9 9950X3D 16-Core Processor\nruntime: node 26.10.0 (x64-linux)\n\nbenchmark                   avg (min … max) p75 / p99    (min … top 1%)\n------------------------------------------- -------------------------------\n• spec document\n------------------------------------------- -------------------------------\nsmol-toml                      2.68 µs/iter   2.68 µs   █\n                        (2.61 µs … 2.91 µs)   2.89 µs  ▅█▇▂\n                    (  4.29 kb …   4.39 kb)   4.30 kb ▇████▅▄▄▁▁▁▁▂▂▁▁▁█▂▁▂\n                   4.41 ipc ( 99.57% cache)    6.85 branch misses\n         14.77k cycles  65.13k instructions   1.43k c-refs    6.19 c-misses\n\n@iarna/toml                    9.71 µs/iter   9.66 µs   █\n                      (9.31 µs … 132.37 µs)  11.48 µs  ▄█▆\n                    (232.00  b … 681.09 kb)  26.28 kb ▁███▆▃▂▁▁▁▁▁▁▁▁▁▁▁▁▁▁\n                   3.85 ipc ( 99.49% cache)   33.76 branch misses\n         55.12k cycles 212.42k instructions   8.62k c-refs   43.87 c-misses\n\n@ltd/j-toml                   48.15 µs/iter  47.84 µs       █▇\n                     (38.21 µs … 312.67 µs)  66.76 µs       ██\n                    (  2.72 kb … 382.48 kb)  35.59 kb ▁▁▁▂▂▁██▄▂▁▁▁▁▁▁▁▁▁▁▁\n                   3.86 ipc ( 99.59% cache)  322.22 branch misses\n        270.56k cycles   1.04M instructions  27.49k c-refs  113.85 c-misses\n\n@std/toml                      4.86 µs/iter   4.60 µs  █\n                      (4.25 µs … 178.46 µs)   8.94 µs  █\n                    (440.00  b … 521.36 kb)  18.02 kb ▄█▅▂▂▂▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁\n                   3.46 ipc ( 99.31% cache)   21.73 branch misses\n         26.86k cycles  92.81k instructions   4.73k c-refs   32.73 c-misses\n\njs-toml                        5.76 µs/iter   5.77 µs             ▃█\n                        (5.69 µs … 5.83 µs)   5.81 µs         ▂ ▇▂██\n                    (  1.94 kb …   7.02 kb)   2.16 kb ▆▁▁▁▁▆▁▆█▆████▆▆▁▆▁▆▆\n                   4.34 ipc ( 99.16% cache)   34.91 branch misses\n         32.34k cycles 140.35k instructions   3.29k c-refs   27.55 c-misses\n\n@decimalturn/toml-patch       59.57 µs/iter  57.71 µs  █\n                     (53.70 µs … 630.39 µs) 110.05 µs  █\n                    (  4.04 kb …   1.10 mb) 108.22 kb ▅█▆▂▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁\n                   3.94 ipc ( 98.84% cache)  787.33 branch misses\n        333.69k cycles   1.32M instructions  48.19k c-refs  561.33 c-misses\n\nsummary\n  smol-toml\n   1.81x faster than @std/toml\n   2.15x faster than js-toml\n   3.62x faster than @iarna/toml\n   17.96x faster than @ltd/j-toml\n   22.22x faster than @decimalturn/toml-patch\n\n• 5MB document\n------------------------------------------- -------------------------------\nsmol-toml                     43.72 ms/iter  47.53 ms █                  █\n                      (40.14 ms … 48.06 ms)  47.98 ms █ █                █\n                    (  9.39 mb …  35.40 mb)  12.82 mb ███▁▁▁▁▁█▁▁▁▁▁▁▁▁▁▁██\n                   2.28 ipc ( 95.29% cache)   1.68M branch misses\n        225.53M cycles 513.97M instructions  15.50M c-refs 730.62k c-misses\n\n@iarna/toml                  134.59 ms/iter 138.20 ms           █\n                    (126.83 ms … 143.64 ms) 138.71 ms           █         █\n                    ( 28.96 mb …  54.84 mb)  42.86 mb █▁▁▁█▁▁█▁▁█▁▁▁██▁▁▁██\n                   2.65 ipc ( 97.36% cache)   4.43M branch misses\n        710.95M cycles   1.88G instructions  84.80M c-refs   2.24M c-misses\n\n@ltd/j-toml                  383.10 ms/iter 388.05 ms                 █\n                    (366.11 ms … 390.91 ms) 389.63 ms              █  █  █\n                    ( 21.44 mb …  22.42 mb)  21.75 mb █▁▁▁▁▁▁▁▁█▁▁██▁▁█▁▁██\n                   3.81 ipc ( 99.05% cache)   4.10M branch misses\n          2.08G cycles   7.93G instructions 182.50M c-refs   1.74M c-misses\n\n@std/toml                     71.01 ms/iter  72.24 ms            █\n                      (62.44 ms … 81.12 ms)  79.64 ms            █\n                    ( 29.44 mb …  62.92 mb)  37.36 mb █▁██▁▁▁██▁██▁▁▁█▁▁▁▁█\n                   2.19 ipc ( 95.42% cache)   1.85M branch misses\n        347.81M cycles 761.47M instructions  31.77M c-refs   1.46M c-misses\n\njs-toml                      107.22 ms/iter 110.20 ms █\n                     (99.03 ms … 114.64 ms) 112.12 ms █             █  █\n                    ( 18.56 mb …  48.98 mb)  42.88 mb █▁▁▁▁▁▁▁▁█▁▁▁▁█▁██▁██\n                   2.50 ipc ( 96.46% cache)   3.18M branch misses\n        573.52M cycles   1.43G instructions  50.22M c-refs   1.78M c-misses\n\n@decimalturn/toml-patch      543.69 ms/iter 570.96 ms    █\n                    (515.23 ms … 583.43 ms) 578.06 ms    █\n                    (112.55 mb … 144.20 mb) 122.09 mb █▁██▁██▁█▁▁▁▁▁▁▁▁▁███\n                   3.30 ipc ( 94.93% cache)   7.55M branch misses\n          2.91G cycles   9.59G instructions 234.01M c-refs  11.85M c-misses\n\nsummary\n  smol-toml\n   1.62x faster than @std/toml\n   2.45x faster than js-toml\n   3.08x faster than @iarna/toml\n   8.76x faster than @ltd/j-toml\n   12.44x faster than @decimalturn/toml-patch\n```\n\n</details>\n\n[Temporal API]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Temporal\n[`Temporal.Duration`]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Temporal/Duration\n[`Temporal.Instant`]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Temporal/Instant\n[`Temporal.PlainDate`]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Temporal/PlainDate\n[`Temporal.PlainDateTime`]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Temporal/PlainDateTime\n[`Temporal.PlainMonthDay`]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Temporal/PlainMonthDay\n[`Temporal.PlainTime`]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Temporal/PlainTime\n[`Temporal.PlainYearMonth`]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Temporal/PlainYearMonth\n[`Temporal.ZonedDateTime`]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Temporal/ZonedDateTime\n\n[toml-lang/toml#514]: https://github.com/toml-lang/toml/issues/514\n[toml-lang/toml#1034]: https://github.com/toml-lang/toml/issues/1034\n[toml-lang/toml#1105]: https://github.com/toml-lang/toml/issues/1105\n\n[RFC 9557]: https://www.rfc-editor.org/info/rfc9557\n","publish_time":1790097334756,"_cnpm_publish_time":1790097334756,"dist-tags":{"latest":"1.9.1"}}