{"library":"nuclide-node-transpiler","title":"nuclide-node-transpiler","description":"A small Node.js module used internally by the Nuclide project to transpile JavaScript files from ES6+ to ES5 or ES6. v0.7.1 is the latest stable version. Release cadence is low; it is not actively updated outside of Nuclide. Key differentiator: it is designed specifically for Node.js server-side code, not for browser bundling, and integrates with Nuclide's module system.","language":"javascript","status":"active","last_verified":"Fri May 01","install":{"commands":["npm install nuclide-node-transpiler"],"cli":null},"imports":["import transpile from 'nuclide-node-transpiler'","import { transpileFile } from 'nuclide-node-transpiler'","import { options } from 'nuclide-node-transpiler'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import transpile, { transpileFile, options } from 'nuclide-node-transpiler';\n\n// Transpile a string of code\nconst code = 'const x = (a) => a + 1;';\nconst result = transpile(code, { presets: ['@babel/preset-env'] });\nconsole.log(result.code);\n\n// Transpile a file\nconst fileResult = transpileFile('./file.js', { presets: ['@babel/preset-env'] });\nconsole.log(fileResult.code);\n\n// Use custom options\noptions.presets = ['@babel/preset-env'];\nconst customResult = transpile(code, options);\nconsole.log(customResult.code);","lang":"typescript","description":"Demonstrates basic usage of default export transpile() and named export transpileFile() with custom options.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}