unist-util-remove-position is a specialized utility within the unified ecosystem, designed to strip the 'position' field from nodes within a unist Abstract Syntax Tree (AST). This is particularly useful when comparing trees, merging them, or when positional information is no longer relevant, such as after processing or when the AST is being used for structural analysis where source location is a distraction. The package is currently at stable version 5.0.0 and is actively maintained by the unified collective, aligning with their standard release cadence that typically drops support for unmaintained Node.js versions with new major releases. It differentiates itself by offering a focused solution for position removal, contrasting with related utilities that extract or stringify position data.
npm install unist-util-remove-positionVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to parse Markdown into a unist AST using `mdast-util-from-markdown` and then remove all `position` fields from its nodes using `unist-util-remove-position`.
Upgrade your Node.js environment to version 16 or newer, or stick to `unist-util-remove-position@^4` for older Node.js versions.
Change calls from `removePosition(node, true)` to `removePosition(node, { force: true })`.Adjust any code that expects a return value from `removePosition`. The function now mutates the tree in-place and explicitly yields `undefined`.
Migrate your project to use ES modules (`import`/`export`) or use a tool like Rollup/Webpack to bundle for CJS environments. For Node.js, ensure your `package.json` specifies `"type": "module"` or use `.mjs` files.
Ensure `@types/unist` is updated to a compatible version and check your `tsconfig.json` for strictness settings that might expose new type issues.
Update your import statement to `import { removePosition } from 'unist-util-remove-position'` and ensure your Node.js project or file is configured for ES Modules (e.g., `"type": "module"` in `package.json`).Use `import { removePosition } from 'unist-util-remove-position'` for ESM. Double-check your environment is correctly configured for ESM if you're getting `ERR_REQUIRE_ESM`.Update the call to `removePosition(node, { force: true })` to use the new options object syntax.Upgrade your Node.js environment to version 16 or newer. Alternatively, if forced to use an older Node.js, downgrade to `unist-util-remove-position@^4`.
No dependency data recorded yet.