{"id":18998,"library":"babel-helper-simple-access","title":"Babel Helper Simple Access","description":"A Babel helper package (currently at v7.0.0-beta.3) that transforms complex assignment patterns (e.g., `i += 1`, `--i`) into simple assignments for easier AST manipulation. It is part of the Babel ecosystem, primarily used internally by Babel plugins. Unlike general-purpose AST utilities, it specifically handles converting compound assignments and unary mutations to straightforward `i = i + 1` style assignments. This package is in beta and likely deprecated in favor of modern Babel 8 helpers.","status":"deprecated","version":"7.0.0-beta.3","language":"javascript","source_language":"en","source_url":"https://github.com/babel/babel/tree/master/packages/babel-helper-simple-access","tags":["javascript"],"install":[{"cmd":"npm install babel-helper-simple-access","lang":"bash","label":"npm"},{"cmd":"yarn add babel-helper-simple-access","lang":"bash","label":"yarn"},{"cmd":"pnpm add babel-helper-simple-access","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Default export; CJS require does not need .default if using default export. Use ESM for clarity.","wrong":"const simpleAccess = require('babel-helper-simple-access').default","symbol":"default","correct":"import simpleAccess from 'babel-helper-simple-access'"},{"note":"The module exports a single function as default export, not named. Removing braces is required.","wrong":"import { simpleAccess } from 'babel-helper-simple-access'","symbol":"simpleAccess","correct":"import simpleAccess from 'babel-helper-simple-access'"},{"note":"The helper works with Babel types. Typically used alongside @babel/types for AST node creation.","wrong":"import t from '@babel/types'","symbol":"types (from @babel/types)","correct":"import * as t from '@babel/types'"}],"quickstart":{"code":"import simpleAccess from 'babel-helper-simple-access';\nimport * as t from '@babel/types';\n\n// Example: convert `i += 1` to `i = i + 1`\nconst ast = t.expressionStatement(\n  t.assignmentExpression('+=', t.identifier('i'), t.numericLiteral(1))\n);\nsimpleAccess(ast, [t.identifier('i')]);\nconsole.log(ast); // Now `ast` contains simple assignment\n\n// Note: This is a low-level helper; not intended for standalone use.","lang":"typescript","description":"Demonstrates using simpleAccess to convert a compound assignment into a simple assignment."},"warnings":[{"fix":"Migrate to @babel/helper-simple-access if available, or use Babel 8 plugins.","message":"This package is part of Babel 7 beta and is deprecated. Use Babel 8's internal helpers instead.","severity":"deprecated","affected_versions":">=7.0.0-beta.3"},{"fix":"Manually handle destructuring or use a different transformation pass.","message":"This helper does not handle destructuring patterns like `{ a } = foo`.","severity":"gotcha","affected_versions":">=7.0.0-beta.3"},{"fix":"Pin to a specific version and test thoroughly.","message":"API may change in future versions; this package is experimental.","severity":"breaking","affected_versions":">=7.0.0-beta.3"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Use `import simpleAccess from 'babel-helper-simple-access'` (default import).","cause":"Incorrect import: using named import instead of default import.","error":"TypeError: simpleAccess is not a function"},{"fix":"Run `npm install babel-helper-simple-access@7.0.0-beta.3` and ensure it's in package.json.","cause":"Package not installed or version mismatch.","error":"Error: Cannot find module 'babel-helper-simple-access'"},{"fix":"Install @babel/types: `npm install @babel/types` and import it.","cause":"Missing @babel/types dependency.","error":"ReferenceError: t is not defined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}