{"library":"snack-babel-standalone","title":"snack-babel-standalone","type":"library","description":"Standalone version of Babel bundled with presets and plugins for React Native, used in Expo Snack Runtime and Website. Version 5.0.0, released as part of the Snack monorepo. Optimized for runtime code parsing/transformation in browser environments, with two separate entrypoints (default for runtime, eslint for @babel/core replacement). Includes metro-react-native-babel-preset and @babel/preset-typescript. Unlike @babel/standalone, this is specifically tailored for React Native/Expo tooling and bundles only necessary dependencies to minimize bundle size.","language":"javascript","status":"active","last_verified":"Sat Apr 25","install":{"commands":["npm install snack-babel-standalone"],"cli":null},"imports":["import * as babel from 'snack-babel-standalone'","import { transform } from 'snack-babel-standalone'","import type { BabelFileResult } from 'snack-babel-standalone'"],"auth":{"required":false,"env_vars":[]},"links":{"homepage":null,"github":"https://github.com/expo/snack","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/snack-babel-standalone","openapi_spec":null,"status_page":null,"smithery":null},"quickstart":{"code":"import * as babel from 'snack-babel-standalone';\n\nconst code = `const x: number = 1;`;\nconst result = babel.transform(code, {\n  presets: ['module:metro-react-native-babel-preset'],\n  plugins: [\n    ['@babel/plugin-proposal-decorators', { legacy: true }],\n  ],\n  filename: 'test.js',\n  sourceMaps: true,\n  compact: false,\n});\nconsole.log(result.code);","lang":"typescript","description":"Demonstrates importing the namespace and transforming TypeScript code with preset and plugin options.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}