Socket
Socket
Sign inDemoInstall

flow-bin

Package Overview
Dependencies
0
Maintainers
11
Versions
338
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    flow-bin

Binary wrapper for Flow - A static type checker for JavaScript


Version published
Maintainers
11
Install size
144 MB
Created

Package description

What is flow-bin?

The flow-bin npm package provides a command-line interface for Flow, a static type checker for JavaScript. Flow helps developers catch common errors early by adding type annotations to JavaScript code.

What are flow-bin's main functionalities?

Type Checking

Flow can be used to add type annotations to JavaScript functions and variables, which helps catch type errors during development.

/* @flow */
function add(a: number, b: number): number {
  return a + b;
}
add(1, 2); // No error
add('1', '2'); // Error: string is incompatible with number

Type Inference

Flow can infer types even if they are not explicitly annotated, providing type safety without requiring extensive type annotations.

/* @flow */
function square(n) {
  return n * n;
}
square(2); // No error
square('2'); // Error: string is incompatible with number

Type Definitions

Flow allows you to import and use type definitions from other files, making it easier to manage and reuse types across a project.

/* @flow */
import type { User } from './types';

function getUser(id: number): User {
  // Implementation
}

Other packages similar to flow-bin

Readme

Source

flow-bin

Binary wrapper for Flow - A static type checker for JavaScript

macOS (x64), Linux (x64, arm64) and Windows (x64) binaries are currently provided.

CLI

For Yarn:

$ yarn add --dev flow-bin
$ yarn run flow --help

For npm, add { "scripts": { "flow": "flow" } } in package.json and run:

$ npm install --save-dev flow-bin
$ npm run flow --help

API

$ npm install --save flow-bin
const execFile = require('child_process').execFile;
const flow = require('flow-bin');

execFile(flow, ['check'], (err, stdout) => {
	console.log(stdout);
});

License

flow-bin is MIT-licensed.

Releases

New Release

  1. make push VERSION=0.122.0 (use the same version as Flow)
  2. Publish to npm: make publish (run npm adduser the first time to log in)

Inspect a Release Before Publishing

npm pack
tar xf "flow-bin-$(node -p 'require("./package.json").version').tgz"
cd package
npm run verify

Keywords

FAQs

Last updated on 16 Nov 2023

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc