{"id":12818,"library":"archieml","title":"ArchieML JavaScript Parser","description":"ArchieML is a lightweight markup language designed for structured text data, frequently employed in journalistic workflows to transform content from Google Documents into machine-readable formats. This JavaScript parser, `archieml-js`, translates ArchieML documents (strings) into JavaScript objects. The current stable version is 0.5.0. Releases for `archieml-js` are typically driven by updates to the external ArchieML specification rather than a fixed time cadence. Its key differentiators include its minimalistic syntax, focus on structured data, and particular utility in pre-processing Google Docs content for data extraction. The library provides a single, straightforward `load` function for parsing ArchieML strings.","status":"active","version":"0.5.0","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/newsdev/archieml-js","tags":["javascript","archie","markup","language","archieml","aml","text","parser"],"install":[{"cmd":"npm install archieml","lang":"bash","label":"npm"},{"cmd":"yarn add archieml","lang":"bash","label":"yarn"},{"cmd":"pnpm add archieml","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"For modern ESM environments. The library exports a default object containing the `load` method.","wrong":"const archieml = require('archieml');","symbol":"archieml","correct":"import archieml from 'archieml';"},{"note":"Standard CommonJS import pattern, common in Node.js applications prior to ESM adoption.","wrong":"import archieml from 'archieml';","symbol":"archieml","correct":"const archieml = require('archieml');"},{"note":"When included directly in a browser via a `<script>` tag, `archieml` becomes a global object.","symbol":"archieml (global)","correct":"<script src=\"archieml.js\"></script>\n<script>var parsed = archieml.load('key: value');</script>"}],"quickstart":{"code":"const archieml = require('archieml');\n\nconst archieMLDocument = `\ntitle: My Awesome Document\nauthor: John Doe\ndate: 2026-04-19\n\n# Introduction\nThis is an introductory paragraph.\nIt spans multiple lines.\n\n.sections[]\nsection: First Section\ncontent: This is the content for the first section.\n\nsection: Second Section\ncontent: This is the content for the second section.\n    A multi-line value for content.\n\n.contact\nname: Jane Smith\nemail: jane@example.com\n\ncomments_example: This should be a value [comment that will be ignored by default]\n`;\n\n// Basic usage\nconst parsedDocument = archieml.load(archieMLDocument);\n\nconsole.log('Parsed Document (default behavior):');\nconsole.log(JSON.stringify(parsedDocument, null, 2));\n\n// Usage with inline comments enabled (deprecated, but still supported with option)\nconst parsedWithComments = archieml.load(archieMLDocument, { comments: true });\n\nconsole.log('\\nParsed Document (with comments enabled):');\nconsole.log(JSON.stringify(parsedWithComments, null, 2));","lang":"javascript","description":"Demonstrates basic parsing of an ArchieML string into a JavaScript object, including how to enable deprecated inline comments."},"warnings":[{"fix":"To continue using inline comments, pass `{ comments: true }` as the second argument to the `load` function: `archieml.load(doc, { comments: true });`","message":"Inline comments were deprecated in ArchieML specification and are disabled by default in `archieml-js` versions >=0.3.0.","severity":"deprecated","affected_versions":">=0.3.0"},{"fix":"Review ArchieML documents for arrays with duplicate keys and adjust document structure or parsing expectations accordingly, as previous values will be overwritten.","message":"In `v0.2.0`, the behavior for arrays defined multiple times changed. Secondary definitions now replace previous definitions, rather than 'reopening' and appending to the original array.","severity":"breaking","affected_versions":">=0.2.0"},{"fix":"Ensure `:skip` blocks are not inadvertently placed within multi-line values, or modify documents to explicitly break values if `:skip` is intended to truncate.","message":"As of `v0.2.0`, `:skip` blocks placed inside a multi-line value will now break up the value, causing only the text *before* the `:skip` block to be stored.","severity":"breaking","affected_versions":">=0.2.0"},{"fix":"Always consult the official ArchieML specification (archieml.org) when designing or troubleshooting ArchieML documents to understand the expected parsing rules for a given version.","message":"The `archieml-js` parser adheres closely to the external ArchieML specification. Changes or clarifications in the official spec can lead to subtle shifts in parsing behavior, even between minor or patch versions of `archieml-js`.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Enable comment parsing by passing an options object to the `load` function: `archieml.load(yourAmlString, { comments: true });`","cause":"Inline comments were deprecated and are disabled by default since v0.3.0.","error":"My inline comments are not being parsed or are included in the value string."},{"fix":"This is the intended behavior since v0.2.0. If you need to append to an array, ensure distinct keys or structure your ArchieML to reflect overwriting behavior.","cause":"Since v0.2.0, re-defining an array key replaces its previous definition, instead of appending to it.","error":"Array redefinition overwrites previous values unexpectedly."},{"fix":"For CommonJS, use `const archieml = require('archieml');`. For ESM, use `import archieml from 'archieml';`. For browsers, include `<script src=\"archieml.js\"></script>` and ensure the `archieml` global is available before use.","cause":"Attempting to use `archieml` without proper import/inclusion for your JavaScript environment (e.g., in a browser without `<script>` tag, or in an ESM module without `import`).","error":"ReferenceError: archieml is not defined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null}