Acorn plugin that adds support for the Object Rest/Spread Properties proposal (e.g., `let { x, y, ...z } = obj`) to Acorn 5. Version 1.1.0 is the latest and only stable release. It is a lightweight, single-purpose plugin that must be injected into an Acorn instance via `require('acorn-object-rest-spread/inject')`. Compared to other parsers like Babel, this plugin keeps Acorn minimal and fast. No updates since 2017; compatible with Acorn 5.x only.
npm install acorn-object-rest-spreadNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Parses a string with object rest/spread properties and logs the AST.
Downgrade to Acorn 5 or switch to a newer parser.
Add the plugin option in the parse call.
Inject plugin only once.
Upgrade to Acorn 6 or later and remove the plugin.
var acorn = require('acorn-object-rest-spread'); acorn.parse(...);Include `plugins: { objectRestSpread: true }` in parse options.