cf

cssauron-falafel

falafel bindings for cssauron

Showing:

Popularity

Downloads/wk

1.3K

GitHub Stars

13

Maintenance

Last Commit

8yrs ago

Contributors

2

Package

Dependencies

1

Size (min+gzip)

3.2KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

cssauron-falafel

cssauron bindings for falafel / esprima JS ASTs.

It shortens the esprima names they're a bit verbose.

It also supports .relation classes -- for example:

if(x) {

}

if(x > y) {

}

if(100) {

}

If we wanted to select all of the if tests ("x", "x > y", "100"), we could use the following selectors:

if > *:first-child                  // lil verbose!
.test                               // test the relation from the parent, not the node type
if > .test                          // more specific -- only ".test" relations from "if" statements.

node types

LabeledStatement        ->  label
BlockStatement          ->  block
Program                 ->  root
ExpressionStatement     ->  expr
ConditionalExpression   ->  ternary
IfStatement             ->  if
BreakStatement          ->  break
ContinueStatement       ->  continue
WithStatement           ->  with
SwitchStatement         ->  switch
ReturnStatement         ->  return
ThrowStatement          ->  throw
TryStatement            ->  try
WhileStatement          ->  while
DoWhileStatement        ->  do-while
ForStatement            ->  for
ForInStatement          ->  for-in
FunctionDeclaration     ->  function
VariableDeclaration     ->  variable-decl
VariableDeclarator      ->  variable
LogicalExpression       ->  binary
BinaryExpression        ->  binary
AssignmentExpression    ->  assign
ArrayExpression         ->  array
ObjectExpression        ->  object
ObjectKeyExpression     ->  key
FunctionExpression      ->  function
SequenceExpression      ->  sequence
UpdateExpression        ->  update
UnaryExpression         ->  unary
CallExpression          ->  call
NewExpression           ->  new
MemberExpression        ->  lookup
SwitchClause            ->  case
CatchClause             ->  catch
DebuggerStatement       ->  debugger
ThisExpression          ->  this
Identifier              ->  id
Literal                 ->  literal

license

MIT

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100