Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
@babel/preset-flow
Advanced tools
The @babel/preset-flow npm package is a Babel preset for transforming Flow syntax. Flow is a static type checker for JavaScript, and this preset allows developers to strip Flow types from their source code to make it compatible with standard JavaScript environments. This is useful for projects that use Flow for type checking but need to remove the type annotations for production builds.
Type Annotations Stripping
This code sample shows a class with Flow type annotations. The @babel/preset-flow will remove the ': number' type annotations when transforming the code.
class MyClass {
size: number;
constructor(size: number) {
this.size = size;
}
}
Interface Stripping
This code sample defines a Flow interface. The @babel/preset-flow will remove the entire interface declaration when transforming the code.
interface Serializable {
serialize(): string;
}
Type Alias Removal
This code sample shows a Flow type alias. The @babel/preset-flow will remove the type alias when transforming the code.
type Point = {
x: number,
y: number
};
Similar to @babel/preset-flow, this package is used to strip TypeScript types from the source code to convert it into plain JavaScript. It serves a similar purpose for TypeScript as @babel/preset-flow does for Flow.
This package is a lightweight alternative to Babel for removing Flow type annotations from files. It is faster and simpler but does not offer the extensive plugin system and transformations that Babel provides.
Babel preset for all Flow plugins.
See our website @babel/preset-flow for more information or the issues associated with this package.
Using npm:
npm install --save-dev @babel/preset-flow
or using yarn:
yarn add @babel/preset-flow --dev
v7.24.6 (2024-05-24)
babel-helper-create-class-features-plugin
, babel-plugin-transform-class-properties
babel-core
, babel-generator
, babel-plugin-transform-modules-commonjs
babel-helper-create-class-features-plugin
, babel-plugin-proposal-decorators
babel-helpers
, babel-plugin-proposal-decorators
, babel-runtime-corejs3
babel-parser
, babel-plugin-transform-typescript
cls.fn<C> = x
(@liuxingbaoyu)babel-core
, babel-helpers
, babel-plugin-transform-runtime
, babel-preset-env
, babel-runtime-corejs2
, babel-runtime-corejs3
, babel-runtime
babel-helpers
tsconfig.json
for @babel/helpers/src/helpers
(@nicolo-ribaudo)babel-cli
, babel-helpers
, babel-plugin-external-helpers
, babel-plugin-proposal-decorators
, babel-plugin-transform-class-properties
, babel-plugin-transform-modules-commonjs
, babel-plugin-transform-modules-systemjs
, babel-plugin-transform-runtime
, babel-preset-env
, babel-runtime-corejs2
, babel-runtime-corejs3
, babel-runtime
babel-parser
, babel-traverse
FAQs
Babel preset for all Flow plugins.
The npm package @babel/preset-flow receives a total of 6,453,106 weekly downloads. As such, @babel/preset-flow popularity was classified as popular.
We found that @babel/preset-flow 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
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.