Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@babel/node
Advanced tools
@babel/node is a command-line tool that allows you to use Babel to compile and run JavaScript code on the fly. It is particularly useful for running scripts and applications written in ES6+ syntax without needing to precompile them.
Running ES6+ scripts
This feature allows you to run JavaScript files that use ES6+ syntax directly. The `babel-node` command compiles the code on the fly and executes it.
babel-node script.js
REPL with ES6+ support
You can start a REPL (Read-Eval-Print Loop) with ES6+ support by simply running `babel-node` without any arguments. This allows you to interactively write and test ES6+ code.
babel-node
Using Babel plugins and presets
You can specify Babel plugins and presets to customize the compilation process. For example, using the `@babel/preset-env` preset ensures that your code is transpiled to be compatible with the current environment.
babel-node --presets @babel/preset-env script.js
ts-node is a TypeScript execution environment and REPL for Node.js. It allows you to run TypeScript code directly without precompiling it. Compared to @babel/node, ts-node is specifically designed for TypeScript, whereas @babel/node is for JavaScript with ES6+ syntax.
esm is a fast, production-ready ES module loader for Node.js. It allows you to use ES modules in Node.js without needing to transpile them. While @babel/node focuses on compiling and running ES6+ syntax, esm focuses on providing native support for ES modules.
Sucrase is a super-fast alternative to Babel that focuses on compiling modern JavaScript syntax. It is designed to be faster than Babel by focusing on a smaller set of transformations. While @babel/node provides a comprehensive solution for compiling and running ES6+ code, Sucrase aims for speed and simplicity.
Babel command line
See our website @babel/node for more information.
Using npm:
npm install --save-dev @babel/node
or using yarn:
yarn add @babel/node --dev
v7.16.0 (2021-10-30)
babel-helpers
, babel-plugin-proposal-async-generator-functions
, babel-runtime-corejs2
, babel-runtime-corejs3
, babel-runtime
for-await
(@nicolo-ribaudo)babel-generator
, babel-parser
, babel-plugin-transform-typescript
, babel-types
babel-parser
babel-helper-fixtures
, babel-helper-transform-fixture-test-runner
, babel-parser
, babel-plugin-syntax-typescript
, babel-preset-typescript
.mts
and .cts
files in @babel/preset-typescript
(@nicolo-ribaudo)@babel/eslint-parser
(@nicolo-ribaudo)babel-generator
, babel-parser
, babel-plugin-proposal-pipeline-operator
, babel-plugin-syntax-pipeline-operator
babel-compat-data
, babel-generator
, babel-parser
, babel-preset-env
, babel-types
babel-helper-skip-transparent-expression-wrappers
, babel-plugin-proposal-optional-chaining
skipTransparentExprWrapperNodes
helper (@lightmare)babel-traverse
, babel-types
babel-parser
, babel-plugin-transform-typescript
babel-plugin-transform-typescript
babel-core
, babel-helper-create-class-features-plugin
, babel-plugin-transform-typescript
babel-compat-data
, babel-plugin-bugfix-safari-id-destructuring-collision-in-function-expression
, babel-plugin-bugfix-v8-spread-parameters-in-optional-chaining
, babel-plugin-transform-react-constant-elements
, babel-preset-env
, babel-traverse
babel-plugin-proposal-async-generator-functions
, babel-traverse
babel-traverse
, babel-types
babel-generator
workspace:^
to specify @babel/
dependencies (@nicolo-ribaudo)babel-helper-fixtures
, babel-plugin-proposal-class-properties
, babel-plugin-transform-runtime
, babel-preset-react
babel-types
createTypeAnnotationBasedOnTypeof
(babel-types) (@lightmare)babel-helpers
babel-core
, babel-plugin-transform-react-jsx-development
, babel-plugin-transform-react-jsx
, babel-types
babel-types
FAQs
Babel command line
We found that @babel/node demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.