
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
flow-runtime-cli
Advanced tools
A command line interface for working with flow-runtime and Flow.
Discovers imported and global type dependencies in your source code and produces a single file containing the flow-runtime type definitions for those dependencies.
Let's say you have some code like this:
/* @flow */
function get (store: Storage, key: string) {
return store.getItem(key);
}
get(localStorage, 'foo');
Storage is a global type, built in to Flow, but flow-runtime itself doesn't know anything about it - if you compile this code, flow-runtime will emit a warning about being unable to resolve a type called "Storage".
A possible solution to this would be to include all the type definitions which come with Flow as part of flow-runtime, but this is wasteful - the file would be very large and most definitions would go unused.
To solve this problem, flow-runtime-cli:
flow-typed or wherever specified by your .flowconfig file.import t from "flow-runtime";
t.declare(
t.class(
"Storage",
t.object(
t.property("length", t.number()),
t.property(
"getItem",
t.function(t.param("key", t.string()), t.return(t.nullable(t.string())))
),
t.property(
"setItem",
t.function(
t.param("key", t.string()),
t.param("data", t.string()),
t.return(t.void())
)
),
t.property("clear", t.function(t.return(t.void()))),
t.property(
"removeItem",
t.function(t.param("key", t.string()), t.return(t.void()))
),
t.property(
"key",
t.function(
t.param("index", t.number()),
t.return(t.nullable(t.string()))
)
),
t.indexer("name", t.string(), t.nullable(t.string()))
)
)
);
You can then import this file once, in your entry point, and flow-runtime will be able to validates values of this type.
npm install flow-runtime-cli
or
yarn add flow-runtime-cli
If your source files are in a folder called src, run:
flow-runtime generate ./src > ./src/typedefs.js
then, in your entry point (e.g. index.js) your first import should be:
import './typedefs';
FAQs
A command line tool for working with flow and flow-runtime.
The npm package flow-runtime-cli receives a total of 28 weekly downloads. As such, flow-runtime-cli popularity was classified as not popular.
We found that flow-runtime-cli 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.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.