
Product
Socket Brings Supply Chain Security to skills.sh
Socket is now scanning AI agent skills across multiple languages and ecosystems, detecting malicious behavior before developers install, starting with skills.sh's 60,000+ skills.
flow-typestrip
Advanced tools
flow-typestrip is a recast based transform to remove Flow type annotations from typed JavaScript code, so that the code can be executed in JavaScript environments.
Alternatives: react-tools also strips type annotations.
flow-typestrip is currently not able to process files with type aliases, declarations and interfaces, because these nodes lack support in ast-types. A pull request to add support is out.
If you need support for this now, you should use react-tools instead.
$ npm install [-D] flow-typestrip
flow-typstrip comes with a command-line interface that can be used when installed globally. Here is how to convert a single file and print to stdout:
$ flow-typestrip source.js
To compile many files at once, specify an output directory:
$ flow-typestrip -o dist src/**/*.js
To enable source maps for this files, add the --source-maps flag.
var flowStrip = require('flow-typestrip');
var result = flowStrip.compile(source, {
sourceFileName: 'example.js',
sourceMapName: 'example.js.map'
});
fs.writeFileSync('result.js', result.code);
fs.writeFileSync('result.js.map', JSON.stringify(result.map));
flow-typestrip can directly be used with browserify:
$ browserify -t flow-typestrip script.js
If you look at the main transform function, it is very simple. To ensure that the types are stripped correctly, I'm using the unit tests from jstransform.
FAQs
A Recast based transform to remove Flow type annotations.
We found that flow-typestrip demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.

Product
Socket is now scanning AI agent skills across multiple languages and ecosystems, detecting malicious behavior before developers install, starting with skills.sh's 60,000+ skills.

Product
Socket now supports PHP with full Composer and Packagist integration, enabling developers to search packages, generate SBOMs, and protect their PHP dependencies from supply chain threats.

Security News
An AI agent is merging PRs into major OSS projects and cold-emailing maintainers to drum up more work.