{"_id":"@one-ini/wasm@0.2.3","bugs":{"url":"https://github.com/one-ini/core/issues"},"dist":{"shasum":"d51a8aa6eeb5d224f75d6f7a14a15aa2c7322dfc","tarball":"http://registry-npm.ywwl.com/@one-ini/wasm/download/@one-ini/wasm-0.2.3.tgz","fileCount":6,"integrity":"sha512-IGdUwmS5uJy9w+OSXIYtmZf6yMtYz18NZ4bm2Rg2oTCt/Cvp24VhpjhtaGG+bwwDs61T4rwAZAnxIOChy9AFiA==","signatures":[{"sig":"MEYCIQCPMqWI7PM2HyHKTXioHqtFPas9fnuY/ka8vuf4FUbNQwIhAK0yQttN1iDv2Prd8py6qy1HZSSrtCpA/OTzvG0NxX8Q","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDgZ/HYUxylYuwd6we4mIAJpBKgHRv1S4b+i8dBqdhPgAiB5ibC8uM+bvlOoG91j/7c0ZTADweyMHzYdd5xh8n1/rw=="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@one-ini%2fwasm@0.2.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":108524,"size":43009,"noattachment":false,"key":"/@one-ini/wasm/-/@one-ini/wasm-0.2.3.tgz"},"main":"one_ini.js","name":"@one-ini/wasm","types":"one_ini.d.ts","gitHead":"b2296edaaaee6faf723523df9ce705aed927ebb8","license":"MIT","version":"0.2.3","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"461fdff2-caae-4bb5-9372-99938c7997f1"}},"homepage":"https://github.com/one-ini/core#readme","keywords":["editorconfig","ini","parser","ast"],"repository":{"url":"git+https://github.com/one-ini/core.git","type":"git"},"_npmVersion":"11.20.0","description":"Parse EditorConfig-INI file contents into AST","directories":{},"maintainers":[{"name":"florianb","email":"florian.neumann@mindkeeper.solutions"},{"name":"hildjj","email":"joe-github@cursive.net"}],"_nodeVersion":"26.13.0","collaborators":["Jed Mao <jedmao@outlook.com>","Joe Hildebrand <joe-github@cursive.net>","Florian Neumann <florian.neumann@mindkeeper.solutions>"],"_hasShrinkwrap":false,"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/wasm_0.2.3_1793870894366_0.7314220987328796"},"readme":"# One INI\n\nThe core implementation of an AST based, idiomatic INI parser which aims to provide an easy to implement and consistent INI-standard.\n\nThis reference implementation is provided as Rust-library and WASM-package.\n\n<!-- markdownlint-disable -->\n\n[![GitHub Actions](https://github.com/jedmao/editorconfig-ini/workflows/Rust/badge.svg?event=push)](https://github.com/jedmao/editorconfig-ini/actions)\n\n<!-- markdownlint-restore -->\n\n<!-- markdownlint-disable commands-show-output -->\n\nThe work on this project started with the search for an universal parser for the [EditorConfig INI file format specification](https://spec.editorconfig.org/#file-format).\n\n## Development setup\n\nInstall Rust via rustup and Node.js 26 (including npm), then run:\n\n```sh\ncargo setup\n```\n\nThis installs `wasm-pack` for WASM builds and `cargo-tarpaulin` for coverage.\nCargo uses the toolchain, components, and WASM target from `rust-toolchain.toml`.\nThe `--locked` install uses each tool's published lockfile; tool versions are not pinned.\n\n## WASM\n\nTo use from [Web Assembly](https://webassembly.org/), compile with:\n\n```sh\nwasm-pack build --release --target nodejs\n```\n\nand run the (limited) WASM tests with:\n\n```sh\nwasm-pack test --node\n```\n\nYou can call the generated JS wrapper with either:\n\n```js\nimport { parse_to_json } from './pkg/one_ini.js'\n\nconst results = parse_to_json(`\nroot = true\n\n[*]\n# always use unix line endings\nend_of_line = lf\n`)\n\n// {\n//   \"version\": \"0.1.0\",\n//   \"body\": [\n//     { \"type\": \"Pair\", \"key\": \"root\", \"value\": \"true\" },\n//     {\n//       \"type\": \"Section\",\n//       \"name\": \"*\",\n//       \"body\": [\n//         { \"type\": \"Comment\", \"indicator\": \"#\", \"value\": \"always use unix line endings\" },\n//         { \"type\": \"Pair\", \"key\": \"end_of_line\", \"value\": \"lf\" }\n//       ]\n//     }\n//   ]\n// }\n```\n\nor:\n\n```js\nimport { parse_to_uint32array, TokenTypes } from './pkg/editorconfig_ini.js'\nconst buf = Buffer.from(`\nroot = true\n\n[*]\n# always use unix line endings\nend_of_line = lf\n`, 'utf8')\nconst ary = parse_to_uint32array(buf)\n\n// Array with token type, start byte offset, end byte offset for each token\n// Uint32Array(21) [\n//   TokenTypes.Key, 1, 5,\n//   TokenTypes.Value, 8, 12,\n//   TokenTypes.Section, 15, 16,\n//   TokenTypes.CommentIndicator, 18, 19,\n//   TokenTypes.CommentValue, 20, 48,\n//   TokenTypes.Key, 49, 60,\n//   TokenTypes.Value, 63, 65\n// ]\n```\n\n## Development\n\nTo get started with local development you will need some Rust tooling.\n\nRustup will install all language specific toolings for Rust, the cargo command installs the WASM-specific helpers.\n\n```\nrustup toolchain install stable\ncargo setup\n```\n\n\n## WASM memory reuse check\n\nFollowing a memory leak report (thanks @onmax), this minimal test checks memory\nreuse on subsequent calls to `parse_to_json` and `parse_to_uint32array`.\n\nBuild a fresh release package and run the Node.js tests:\n\n```sh\nwasm-pack build --release --scope one-ini --target nodejs\nnode --test --test-reporter=tap tests/wasm-memory.cjs\n```\n\nEach parse export gets a fresh WASM instance and the same input containing 128\npairs with index-prefixed keys and values. After 100 warm-up calls, the test checks\nthat another 100 calls do not grow linear memory. Results are discarded. TAP output\nincludes the before/after memory sizes, and memory growth fails the test.\n\nContinued growth flags a potential leak. Stable memory demonstrates reuse for\nthis workload, but cannot exclude every leak. Freed WASM allocations are reusable;\nlinear memory is not expected to shrink. This check measures WASM memory only.\n","publish_time":1793870894488,"_cnpm_publish_time":1793870894488,"dist-tags":{"latest":"0.2.3"}}