Socket
Socket
Sign inDemoInstall

flow-bin

Package Overview
Dependencies
2
Maintainers
1
Versions
342
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
Weekly downloads
308K
decreased by-5.23%
Maintainers
1
Created
Weekly downloads
 

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 Build Status

Binary wrapper for Flow - a static type checker for JavaScript

CLI

$ npm install --global flow-bin
$ flow --help

API

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

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

License

MIT © Sindre Sorhus

Keywords

FAQs

Last updated on 18 Nov 2014

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc