{"_id":"@asciidoctor/reducer","_rev":"3-ac28d980a231287dfa717bd0512a191f","name":"@asciidoctor/reducer","dist-tags":{"latest":"1.1.2"},"versions":{"1.1.0":{"name":"@asciidoctor/reducer","version":"1.1.0","keywords":["asciidoc","asciidoctor","extension","include","preprocessor"],"author":{"name":"Dan Allen"},"license":"MIT","_id":"@asciidoctor/reducer@1.1.0","maintainers":[{"name":"mojavelinux","email":"dan.j.allen@gmail.com"},{"name":"ggrossetie","email":"ggrossetie@gmail.com"},{"name":"obilodeau","email":"olivier@bottomlesspit.org"}],"contributors":[{"name":"Dan Allen","email":"dan@opendevise.com"}],"homepage":"https://github.com/asciidoctor/asciidoctor-reducer#readme","bugs":{"url":"https://github.com/asciidoctor/asciidoctor-reducer/issues"},"dist":{"shasum":"928cfb65ec5f3c7e251f1bde490d0f06eb5ff9af","tarball":"https://registry.npmjs.org/@asciidoctor/reducer/-/reducer-1.1.0.tgz","fileCount":5,"integrity":"sha512-9NG4F/RMPwzquIHnYAzn84b2Uam2oCIfOEPBFhTtYRrN1rY9IOq1sFAprxXLbDUcDkxI5DThV2jawpM88AunEQ==","signatures":[{"sig":"MEYCIQC7x09vvQC5d3p5nI1HUZLdnXsBf99UCB1pxrpR7UGAfwIhAMIQL7FZmEFtNf9q+awY7dqVuhz/Slz2Xgj9gRnGgjlw","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":32025},"main":"lib/index.js","engines":{"node":">=16.0.0"},"exports":{".":"./lib/index.js","./dist/*":"./dist/*","./extensions":"./lib/extensions.js","./package.json":"./package.json"},"gitHead":"72d8e59f9872c2384c0afd73061678d8702996ec","scripts":{"ci":"npm run build","test":"node --test test/*-test.js","build":"npx -y --package opal-compiler@1.0.13 node npm/transpile.js","clean":"npx rimraf dist node_modules","preci":"npm i","postci":"npm test","postpublish":"npx -y downdoc --postpublish","prepublishOnly":"npx -y downdoc --prepublish"},"_npmUser":{"name":"mojavelinux","email":"dan.j.allen@gmail.com"},"repository":{"url":"git+https://github.com/asciidoctor/asciidoctor-reducer.git","type":"git"},"_npmVersion":"10.9.0","description":"An Asciidoctor.js extension to reduce an AsciiDoc document containing includes and conditionals to a single AsciiDoc document.","directories":{},"_nodeVersion":"22.11.0","_hasShrinkwrap":false,"devDependencies":{"@asciidoctor/core":"~2"},"_npmOperationalInternal":{"tmp":"tmp/reducer_1.1.0_1732490879214_0.8781870835243277","host":"s3://npm-registry-packages"}},"1.1.1":{"name":"@asciidoctor/reducer","version":"1.1.1","keywords":["asciidoc","asciidoctor","extension","include","preprocessor"],"author":{"name":"Dan Allen"},"license":"MIT","_id":"@asciidoctor/reducer@1.1.1","maintainers":[{"name":"mojavelinux","email":"dan.j.allen@gmail.com"},{"name":"ggrossetie","email":"ggrossetie@gmail.com"},{"name":"obilodeau","email":"olivier@bottomlesspit.org"}],"contributors":[{"name":"Dan Allen","email":"dan@opendevise.com"}],"homepage":"https://github.com/asciidoctor/asciidoctor-reducer#readme","bugs":{"url":"https://github.com/asciidoctor/asciidoctor-reducer/issues"},"dist":{"shasum":"8cfb55355181ba683039fe65740b8908183878c9","tarball":"https://registry.npmjs.org/@asciidoctor/reducer/-/reducer-1.1.1.tgz","fileCount":5,"integrity":"sha512-OmSBStkPvVPdlxlR85bXk23fiUQPdvNcweDXtZYHWJ2b+RTNrDA5sO2gj+uig9UryspeKLdeBb+rgE7vXhcdOw==","signatures":[{"sig":"MEUCIQCN9f8Lg8jGPQe5j/1CgxWWyrUqgkZ+2ZVzq84DNqnYAgIgHNMsuMeIWNi/G3oCphLH3i1dtsuFzYoFB5K+ZAdms5I=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":34127},"main":"lib/index.js","engines":{"node":">=16.0.0"},"exports":{".":"./lib/index.js","./dist/*":"./dist/*","./extensions":"./lib/extensions.js","./package.json":"./package.json"},"gitHead":"89fb27d860f2d5ba3d61b4bd621133743ed9cb0d","scripts":{"ci":"npm run build","test":"node --test test/*-test.js","build":"npx -y --package opal-compiler@1.0.13 node npm/transpile.js","clean":"npx rimraf dist node_modules","preci":"npm i","postci":"npm test","postpublish":"npx -y downdoc --postpublish","prepublishOnly":"npx -y downdoc --prepublish"},"_npmUser":{"name":"mojavelinux","email":"dan.j.allen@gmail.com"},"repository":{"url":"git+https://github.com/asciidoctor/asciidoctor-reducer.git","type":"git"},"_npmVersion":"10.9.2","description":"An Asciidoctor.js extension to reduce an AsciiDoc document containing includes and conditionals to a single AsciiDoc document.","directories":{},"_nodeVersion":"22.14.0","_hasShrinkwrap":false,"devDependencies":{"@asciidoctor/core":"~2"},"_npmOperationalInternal":{"tmp":"tmp/reducer_1.1.1_1743070311690_0.7691808338350619","host":"s3://npm-registry-packages-npm-production"}},"1.1.2":{"name":"@asciidoctor/reducer","version":"1.1.2","description":"An Asciidoctor.js extension to reduce an AsciiDoc document containing includes and conditionals to a single AsciiDoc document.","license":"MIT","author":{"name":"Dan Allen"},"contributors":[{"name":"Dan Allen","email":"dan@opendevise.com"}],"repository":{"type":"git","url":"git+https://github.com/asciidoctor/asciidoctor-reducer.git"},"bugs":{"url":"https://github.com/asciidoctor/asciidoctor-reducer/issues"},"scripts":{"build":"npx -y --package opal-compiler@1.0.13 node npm/transpile.js","preci":"npm i","ci":"npm run build","postci":"npm test","clean":"npx rimraf dist node_modules","postpublish":"npx -y downdoc --postpublish","prepublishOnly":"npx -y downdoc --prepublish","test":"node --test test/*-test.js"},"main":"lib/index.js","exports":{".":"./lib/index.js","./extensions":"./lib/extensions.js","./dist/*":"./dist/*","./package.json":"./package.json"},"devDependencies":{"@asciidoctor/core":"~2"},"engines":{"node":">=16.0.0"},"keywords":["asciidoc","asciidoctor","extension","include","preprocessor"],"_id":"@asciidoctor/reducer@1.1.2","gitHead":"c8185ad9d50daff287cba69cc2260beae9010afc","homepage":"https://github.com/asciidoctor/asciidoctor-reducer#readme","_nodeVersion":"22.15.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-TlCkQJZU5TGts6kwUrpmE4R6FkoDPPe+DaW/GYF2BdOSbdmL8f6t7D4hPZRAb4fMMGKhSNHcZv1aYGR64QIVnA==","shasum":"4ff8a251b81d68e8f8d5405454f523a7f041d2e8","tarball":"https://registry.npmjs.org/@asciidoctor/reducer/-/reducer-1.1.2.tgz","fileCount":5,"unpackedSize":34507,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDjk6/9UuhpeexcTNxBZsu36DJsygqXYnrDdVkZgsBnoAIhAJj3f3KLjvetTl3o0d5C0avPDZla1ohArvqKOSJJaKP+"}]},"_npmUser":{"name":"mojavelinux","email":"dan.j.allen@gmail.com"},"directories":{},"maintainers":[{"name":"mojavelinux","email":"dan.j.allen@gmail.com"},{"name":"ggrossetie","email":"ggrossetie@gmail.com"},{"name":"obilodeau","email":"olivier@bottomlesspit.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/reducer_1.1.2_1746809345526_0.3681587979935175"},"_hasShrinkwrap":false}},"time":{"created":"2024-11-24T23:27:59.032Z","modified":"2025-05-09T16:49:06.028Z","1.1.0":"2024-11-24T23:27:59.386Z","1.1.1":"2025-03-27T10:11:52.007Z","1.1.2":"2025-05-09T16:49:05.745Z"},"bugs":{"url":"https://github.com/asciidoctor/asciidoctor-reducer/issues"},"author":{"name":"Dan Allen"},"license":"MIT","homepage":"https://github.com/asciidoctor/asciidoctor-reducer#readme","keywords":["asciidoc","asciidoctor","extension","include","preprocessor"],"repository":{"type":"git","url":"git+https://github.com/asciidoctor/asciidoctor-reducer.git"},"description":"An Asciidoctor.js extension to reduce an AsciiDoc document containing includes and conditionals to a single AsciiDoc document.","contributors":[{"name":"Dan Allen","email":"dan@opendevise.com"}],"maintainers":[{"name":"mojavelinux","email":"dan.j.allen@gmail.com"},{"name":"ggrossetie","email":"ggrossetie@gmail.com"},{"name":"obilodeau","email":"olivier@bottomlesspit.org"}],"readme":"# Asciidoctor Reducer\n\nAn Asciidoctor.js extension that reduces an AsciiDoc document containing include directives to a single AsciiDoc document by expanding the includes reachable from the parent document.\nAdditionally, the extension evaluates preprocessor conditionals (unless the option to preserve them is enabled), only keeping those lines from conditions which are true.\nIf the document does not contain any preprocessor directives, the extension provides access to the unmodified source.\n\n(The CLI and API are not currently available in the JavaScript version).\n\n## Install\n\nThis package depends on the `asciidoctor` package (>= 2.2.0, &lt; 3.0.0), but doesn’t declare it as a dependency.\nTherefore, you must install that package when installing this one.\n\n```console\n$ npm i asciidoctor @asciidoctor/reducer\n```\n\nIf you’re using the extension with Antora, there’s no need to install the `asciidoctor` package as Antora provides it.\n\n## Usage\n\n### Extension\n\nYou can use this extension in combination with the load API provided by Asciidoctor.\nIf you want to register the extension globally, require the library as follows:\n\n```js\nconst Asciidoctor = require('asciidoctor')()\n\nrequire('@asciidoctor/reducer').register()\n```\n\nWhen you use the Asciidoctor load API, the document will automatically be reduced.\nYou can access the reduced source by calling either the `getSource()` or `getSourceLines()` on the loaded document.\n\n```js\nconst doc = Asciidoctor.loadFile('main.adoc', { safe: 'safe' })\n\nconsole.log(doc.getSource())\n```\n\nYou can pass a registry instance to the `register` method to register the extension with a scoped registry (scoped to the load API call).\n\n```js\nconst Asciidoctor = require('asciidoctor')()\n\nconst registry = Asciidoctor.Extensions.create()\nrequire('@asciidoctor/reducer').register(registry)\n\nconst doc = Asciidoctor.loadFile('main.adoc', { extension_registry: registry, safe: 'safe' })\n```\n\nYou can also require `@asciidoctor/reducer/extensions` to access the `Extensions` class.\n\n## Copyright and License\n\nCopyright (C) 2021-present Dan Allen and the individual contributors to this project.\nUse of this software is granted under the terms of the MIT License.\n\n## Trademarks\n\nAsciiDoc(R) and AsciiDoc Language(TM) are trademarks of the Eclipse Foundation, Inc.\n","readmeFilename":"README.md"}