• Stars
    star
    258
  • Rank 158,189 (Top 4 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created almost 8 years ago
  • Updated 7 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Shrimpit 🍤 is a small CLI analysis tool for checking unused JavaScript, JSX & Vue templates ES6 exports in your project.

Shrimpit 🍤 Build Status npm version Standard - JavaScript Style Guide

Shrimpit is a small CLI analysis tool for checking unused JavaScript, JSX & Vue templates ES6 exports in your project.

Install

npm

npm i -g shrimpit

yarn

yarn global add shrimpit

Usage

shrimpit path/to/your/files /another/path

Globbing patterns are also supported:

shrimpit test/**/*.js

Adding the --tree flag will output the complete files tree with all the imports and the exports per file:

shrimpit --tree path/to/your/files

Please note that default unnamed exports are rendered as default (unnamed):

shrimpit test --tree
 Shrimpit!

 > Files tree

{ test:
   { core:
      { a:
         { 'a.js':
            { imports:
               [ { location: 'test/core/b/b.js',
                   name: 'test',
                   unnamedDefault: true },
                 { location: 'test/core/b/b.js',
                   name: 'a',
                   unnamedDefault: false },
                 { location: 'test/core/c/c.js',
                   name: 'User',
                   unnamedDefault: true } ],
              exports:
               [ { location: 'test/core/a/a.js',
                   name: 'a',
                   unnamedDefault: false },
                 { location: 'test/core/a/a.js',
                   name: 'c',
                   unnamedDefault: false },
                 { location: 'test/core/a/a.js', name: 'd', unnamedDefault: true } ] } },
        b:
         { 'b.js':
            { imports:
               [ { location: 'test/core/c/c.js',
                   name: 'Cat',
                   unnamedDefault: false },
                 { location: 'test/core/d/d.js',
                   name: 'unamedFunction',
                   unnamedDefault: true },
                 { location: 'test/core/a/a.js',
                   name: 'a',
                   unnamedDefault: false },
                 { location: 'test/core/a/a.js',
                   name: 'c',
                   unnamedDefault: false },
                 { location: 'test/core/a/a.js', name: 'd', unnamedDefault: true } ],
              exports:
               [ { location: 'test/core/b/b.js',
                   name: 'a',
                   unnamedDefault: false },
                 { location: 'test/core/b/b.js',
                   name: 'b',
                   unnamedDefault: false },
                 { location: 'test/core/b/b.js',
                   name: 'default (unnamed)',
                   unnamedDefault: true } ] } },
        c:
         { 'c.js':
            { imports:
               [ { location: 'test/core/a/a.js',
                   name: 'a',
                   unnamedDefault: false },
                 { location: 'test/core/a/a.js',
                   name: 'c',
                   unnamedDefault: false },
                 { location: 'test/core/a/a.js',
                   name: 'd',
                   unnamedDefault: false },
                 { location: 'test/core/b/b.js',
                   name: 'b',
                   unnamedDefault: false } ],
              exports:
               [ { location: 'test/core/c/c.js',
                   name: 'Cat',
                   unnamedDefault: false },
                 { location: 'test/core/c/c.js',
                   name: 'User',
                   unnamedDefault: true } ] } },
        d:
         { 'd.js':
            { imports: [],
              exports:
               [ { location: 'test/core/d/d.js',
                   name: 'test/core/d',
                   unnamedDefault: true } ] } } } } }

 > Unused exports

All Clear Ahead, Captain.

Flow & Vue

Shrimpit supports Flow annotations and Vue templates out of the box!

TypeScript (experimental)

Since Babel 7, the TypeScript AST can directly be parsed. You can use the --typescript flag to enable it:

shrimpit --tree --typescript path/to/your/files

Please note that the Flow and TypeScript parsers are mutually exclusive.

Linting

The code quality is checked by the JavaScript Standard Style.

License

Released under the MIT license by Davy Duperron.

More Repositories

1

jql

A JSON Query Language CLI tool
Rust
1,471
star
2

hypergraph

Hypergraph is data structure library to create a directed hypergraph in which a hyperedge can join any number of vertices.
Rust
274
star
3

babel-react-rollup-starter

A simple boilerplate for web apps with React, Babel, and Rollup.
JavaScript
121
star
4

craftql

A CLI tool to visualize GraphQL schemas and to output a graph data structure as a graphviz .dot format
Rust
108
star
5

rust-wasm-webpack

A simple boilerplate to get WebAssembly (WASM) code generated by Rust and bundled by Webpack!
JavaScript
88
star
6

buble-react-rollup-starter

A simple starter project to build cool React applications with Bublé and Rollup.
JavaScript
73
star
7

pattern-guard

JavaScript pattern guards 💂
JavaScript
68
star
8

picst

A cross-platform CLI tool to resize clipboard images on the fly
Rust
37
star
9

reflex-starter

A simple starter project for building Reflex applications with Stack.
Shell
36
star
10

Sigma.io

Sigma.io - Create and share data in true real-time
JavaScript
5
star
11

yume

An encrypted peer-to-peer IPv6 UDP messaging terminal client built with Rust
Rust
5
star
12

extend-package-scripts-example

An example of how to extend your package.json scripts by passing extra files or flags as arguments.
JavaScript
4
star
13

docker-flowtype

A Docker image for Flow based on ocaml/opam:debian-8_ocaml-4.03.0
4
star
14

nixos-configuration

Nix
3
star
15

react-vr-typescript

Create amazing 360 and VR content using React & TypeScript
JavaScript
3
star
16

hyperzig

HyperZig - A Hypergraph Implementation in Zig
Zig
2
star
17

git-chart-js

A simple chart rendering Angular app
JavaScript
1
star
18

polymer-game

JavaScript
1
star
19

ruster

A Docker image for Rust based on alpine:edge
1
star
20

yamafaktory

That's me!
1
star
21

.emacs.d

Emacs Lisp
1
star
22

roost

Rust
1
star
23

lumberjack.vim

Vim Script
1
star