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

flow-remove-types

Package Overview
Dependencies
Maintainers
1
Versions
245
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flow-remove-types

Removes Flow type annotations from JavaScript files with speed and simplicity.


Version published
Weekly downloads
144K
increased by0.14%
Maintainers
1
Weekly downloads
 
Created

What is flow-remove-types?

The flow-remove-types npm package is a tool designed to strip Flow type annotations from JavaScript code. This is useful for projects that use Flow for type checking but need to remove the type annotations for production builds or for compatibility with environments that do not support Flow.

What are flow-remove-types's main functionalities?

Remove Flow Types from JavaScript Code

This feature allows you to remove Flow type annotations from a string of JavaScript code. The input code contains Flow type annotations, and the output will be the same code without the type annotations.

const flowRemoveTypes = require('flow-remove-types');
const input = '/* @flow */\nfunction square(n: number): number {\n  return n * n;\n}';
const output = flowRemoveTypes(input);
console.log(output.toString());

Remove Flow Types from Files

This feature allows you to remove Flow type annotations from a JavaScript file. The input file contains Flow type annotations, and the output file will be the same code without the type annotations.

const fs = require('fs');
const flowRemoveTypes = require('flow-remove-types');
const inputFilePath = 'path/to/input.js';
const outputFilePath = 'path/to/output.js';
const inputCode = fs.readFileSync(inputFilePath, 'utf8');
const output = flowRemoveTypes(inputCode);
fs.writeFileSync(outputFilePath, output.toString());

Other packages similar to flow-remove-types

Keywords

FAQs

Package last updated on 18 Oct 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