Skip to main content

Javascript (Flow)

The Javascript/Flow indexer is built into the Flow system. It's also included in the Glean demo Docker image to try out.

Run the indexer#

flow glean DIR --output-dir JSON --write-root PREFIX

where

  • DIR is the root directory containing the Javascript/Flow files
  • JSON is the directory in which to write the output .json files
  • PREFIX is a prefix to add to the files in the Glean index (this can be empty if you don't need a prefix)

The generated files can be ingested into a Glean database using glean create.

Derived predicates#

Several predicates should be derived after indexing. For each stored predicate in the schema you should glean derive the predicate.

In the shell#

Flow source can also be indexed directly from the Glean shell:

:index flow DIR

Schema#

The schema is in glean/schema/source/flow.angle