Socket
Book a DemoInstallSign in
Socket

jik

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jik

use css selectors to grep your JS codebase

latest
Source
npmnpm
Version
0.2.0
Version published
Maintainers
1
Created
Source

jik

A JavaScript-searching chainsaw! Query by AST shape! Print arbitrary output per selected AST node!

Find potential constructed-HTML XSS vectors in your site:

$ jik 'call > *:first-child + binary[operator=\+] > literal:contains(>)' js/

Give it more context than just the innermost node!

$ jik 'call > *:first-child + binary[operator=\+] > literal:contains(>)' \
  '{print($POS, parents("call"))}' js/

Find signed int conversions in your codebase!

$ jik 'binary[operator=\|] > literal, assign[operator=\|\=], unary[operator=\~] > unary[operator=\~]' js/

List all of the function names defined in your codebase!

$ jik \
  'function[id] > id:first-child, :any(assign,variable) > id + function' \
  '{print($POS, (is("function") ? $NODE.parent.id || $NODE.parent.left : $NODE))}' \
  js/

basic usage

jik <selector> [<action>] <target> [<target>...]

Where selector is a cssauron-falafel selector, action is any valid javascript surrounded by {}, and <target> is a file or directory. Directory targets are recursed and every entry ending with .js is searched.

The help -- accessed via jik --help has an extensive description of the selector language and available variables in actions.

installation

npm install -g jik

license

MIT

Keywords

cli

FAQs

Package last updated on 07 May 2014

Did you know?

Socket

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