{"id":25119,"library":"constructuring","title":"Constructuring","description":"Constructuring is an ES6-to-ES3 transpiler specifically for the destructuring feature. It transforms JavaScript code using ES6 destructuring (arrays and objects) into ES3-compatible code that runs in older browsers. Current version 0.0.3, with no recent updates indicating it is no longer maintained. It operates on source strings or esprima ASTs, making it suitable for integration into build pipelines that already use esprima and escodegen. Compared to broader transpilers like Babel, Constructuring focuses only on destructuring, which may be useful for targeted transformations but lacks active development and broader language feature support.","status":"abandoned","version":"0.0.3","language":"javascript","source_language":"en","source_url":"https://github.com/fabiomcosta/constructuring","tags":["javascript","destructuring","destructure","es6","transformation","rewriting","transpiler","compiler","desugaring"],"install":[{"cmd":"npm install constructuring","lang":"bash","label":"npm"},{"cmd":"yarn add constructuring","lang":"bash","label":"yarn"},{"cmd":"pnpm add constructuring","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"AST parsing for JavaScript source code","package":"esprima","optional":true},{"reason":"Generating JavaScript from AST after transformation","package":"escodegen","optional":true}],"imports":[{"note":"Package is CommonJS-only; no ESM exports available.","wrong":"import { transformSource } from 'constructuring';","symbol":"transformSource","correct":"const { transformSource } = require('constructuring');"},{"note":"Alternative correct import for AST-based usage.","wrong":"const transform = require('constructuring').transform;","symbol":"transform","correct":"const { transform } = require('constructuring');"},{"note":"Default export is the module itself, but named exports are preferred.","wrong":"import constructuring from 'constructuring';","symbol":"default","correct":"const constructuring = require('constructuring');"}],"quickstart":{"code":"const { transformSource } = require('constructuring');\nconst fs = require('fs');\nconst source = fs.readFileSync('module.js', 'utf8');\nconst result = transformSource(source);\nconsole.log(result);\n// Also AST-based:\nconst esprima = require('esprima');\nconst escodegen = require('escodegen');\nconst ast = esprima.parse(source);\nconst { transform } = require('constructuring');\ntransform(ast);\nconsole.log(escodegen.generate(ast));","lang":"javascript","description":"Shows both source transformation and AST-based transformation using constructuring."},"warnings":[{"fix":"Use a modern transpiler like Babel or SWC for full ES6+ support.","message":"Package is abandoned; last version 0.0.3 released years ago. No support for modern JavaScript or ES6 beyond destructuring.","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Use require() or wrap in a bundler that supports CJS.","message":"Package is CommonJS-only; will not work with ESM imports without a bundler or wrapper.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Clone the AST before passing if you need the original for other purposes.","message":"Transform functions mutate the AST if provided; ensure you have a copy if needed.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Create your own .d.ts or use @ts-ignore.","message":"No official TypeScript definitions; any type safety must be manually added.","severity":"breaking","affected_versions":">=0.0.0"},{"fix":"Do not use in production; fork and update dependencies if necessary.","message":"No security patches or updates; known vulnerabilities in dependencies (esprima, escodegen) may be present.","severity":"deprecated","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use const { transformSource } = require('constructuring');","cause":"Incorrect import: using default import instead of named import in CommonJS.","error":"TypeError: transformSource is not a function"},{"fix":"First transpile with a broader tool like Babel, or ensure input only uses destructuring.","cause":"Source code contains ES6 syntax beyond destructuring (e.g., arrow functions) which constructuring cannot handle.","error":"SyntaxError: Unexpected token ="},{"fix":"Run npm install constructuring --save or check spelling: 'constructuring' (note: not 'constructuring').","cause":"Package is not installed or name is misspelled.","error":"Module not found: Can't resolve 'constructuring'"},{"fix":"npm install esprima escodegen","cause":"When using AST mode, esprima and escodegen must be installed separately.","error":"Error: Cannot find module 'esprima'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}