Code search.
Accurate and reliable.
Search source code with a declarative language.
Fast and requires no AST magic.
Find statements in code, regardless of how they’re formatted.
Find values – like a string literal – accurately using a high-level query language.
Look for different values using composition.
Match a set of values using regular expressions.
Find a specific type, like a function of a certain name, or an identifier with that name.
Search inside object and array literals, precisely and at any depth.
Find calls to functions. Refine your search to calls made with specific arguments.
Find access to member properties, reliably.
Follow references to a value you know, but don’t know where it is stored.
Use dynamic imported identifiers in your queries, when static identifiers are not enough.
Print the exact portion you need, like an attribute value of matching JSX elements.
Confine your search to a particular lexical scope, like the global module’s. Find eager calls reliably.
Cross-platform
Right in your favorite IDE.
Power at your fingertips.
A powerful command-line interface,
ready to integrate with your favorite tooling.
Windows, Mac and Linux.
A private web sandbox.
Load code from disk – no upload required.
Great for learning.
Express with precision
Describe exactly what you’re looking for and receive far less noise and fewer false positives.
Investigate with confidence
Miss less in your search and stop worrying about a quote, a newline, a comment, or some syntactic element you don’t care about.
Save time and energy
Because searching with SYNG yields finer results, you get to focus on exactly what you’re looking for.
Incorporate more parameters in your search to access more parts of your program — easily and reliably.
Parameter | Text-based Search (e.g. grep ) | Structure-based Search (e.g. syng ) |
---|---|---|
Filepath | Yes | Yes |
Text | Yes, subject to the way the text is formatted (e.g. quotes, newlines, etc.) | Yes, and unhindered by formatting |
Type (of statement) | No | Yes, e.g. a function declaration will not be confused with a variable declaration |
Value (of expression) | No | Yes, e.g. a value of a string literal will not be confused with that same string in a function’s name |
Position | Maybe – it depends on the format, the position you’re after, and how good your regular expression is | Yes, e.g. the argument a function was called with can be targeted based on its position |
Hierarchy | Maybe, see above | Yes, an object nested inside another can be targeted explicitly and with no ambiguity |
Lexical scope | No | Yes, the scope in which a declaration is made is targetable and can be used, for example, to find statements made in the global module’s scope |
Indirection (e.g. references) | No | Maybe – unless the indirection crosses file boundaries or requires evaluation to recognize, SYNG can follow references to a value |
Gain an Edge
Easier Refactoring
Wondering whether a function signature can be safely changed, or just how much work it would take to rename that particular data model? Make daily decisions faster and better with SYNG.
Accessible Analysis
Wondering what kind of arguments a function is ever called with? You don’t need to be an expert in compilers and ASTs – or a wizard – to find out.
Better Discovery
Explore a new codebase, or perhaps darker areas of an old one, with free-form “span” queries. All you need is a word or term to start with, and SYNG will start your discovery trail.
Built for Power
A plethora of features for near-maximum control.
By programmers for programmers.
Extensive Language Support
Match most JavaScript statements, from variable declarations to function calls and JSX attributes.
Simple Query Language
Learn a minimal syntax and gain access to dozens of selectors and operators – functions that match the syntactic elements of the language and control the scanner:
(id) (str) (num) (bool) (regex) (null) (fun) (var) (call) (mem) (arr) (el) (obj) (prop) (jsx) (attr) (child) (:and) (:or) (:not) (:into) (:ref) (:at) (:under)
Combine those functions and many more to form elaborate queries.
Stable, Clear API
If you’re used to writing your own AST programs, you no longer have to consult dry manuals or worry about missing part of the spec.
Selection Refinement
Display precise portions of matching statements, like the value of a JSX element attribute, or the first argument to a function call.
Selection Confinement
Find statements at or under a specific lexical scope, like the global module’s.
Value Dereferencing
Follow a literal value through any of its bindings. If you’re looking for the number 4, and somewhere declares that `let x = 4`, SYNG will show you both `4` and `x`.
Pattern Matching
Use regular expressions to match wider sets of values. Ideal for when your target is not clear or difficult to enumerate.
Free-Form Selection
Search literal source code for a word or pattern. Unlike a text-based search, formatting and insignificant tokens (e.g. comments) are disregarded. Can be used as a last resort for when your target is unknown.
Super-type Selection
Search for values that may appear across different types, like a word in String or Template literals, or an object property of a certain name.
Composition
Form unions, intersections and negations of selectors to describe your target with the utmost precision.
ES Module Selection
Follow imported identifiers to find their use in other statements, like a function call.
Speed
SYNG is fast. It’s written in Rust and uses a highly-tuned algorithm. On a modern MacBook, it can scan a mixture of JavaScript and TypeScript files at a rate of 3000 files or 200,000 LOC per second.