Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@babel/preset-flow

Package Overview
Dependencies
Maintainers
4
Versions
78
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/preset-flow

Babel preset for all Flow plugins.

  • 7.0.0-beta.32
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6.9M
decreased by-5.61%
Maintainers
4
Weekly downloads
 
Created

What is @babel/preset-flow?

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.

What are @babel/preset-flow's main functionalities?

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
};

Other packages similar to @babel/preset-flow

Keywords

FAQs

Package last updated on 12 Nov 2017

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc