Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including elm-impfix with all npm packages installed. Try it out:

elm-impfix lists no main file and has no index.js, so it can't be directly required. If this is a mistake, please let us know. It may however contain internal files that you can require manually:

// require("elm-impfix/[??]")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

elm-impfix v1.0.8

Removes unused imports from Elm modules

elm-impfix

Command-line tool to remove unused imports from Elm modules.

Install

$ npm install -g elm-impfix

Usage

$ elm-impfix MyModule.elm -o ../build/MyModule.elm

The use case is explained on the Github page.

Flags

Output (optional)

$ elm-impfix MyModule.elm -o path/to/output.elm

Defaults to name_Impfix.ext (if source = name.ext). Use "/" in paths.

Qualifying unqualified imports (optional)

$ elm-impfix MyModule.elm -q path/to/ImportedModule.elm
$ elm-impfix MyModule.elm -q "Imported1.elm Imported2.elm"

Makes unqualified imports explicit ("import ImportedModule exposing (..)" > "import ImportedModule exposing (this, that)").

Wildcards

All params support wildcards:

$ elm-impfix "*.elm"  -o "../build/*.*"  -q "./Imports/*.elm"

Wildcard params must be quoted.

To overwrite all source files, use the -r (--replace) flag. To recursively overwrite all .elm files in a folder, use

elm-impfix "folder/**/*.elm" -r

To exclude some files from the output wildcard, use -x (--exclude):

elm-impfix "folder/**/*.elm" -r -x "folder/elm-stuff/**/*.*"

Bugs

Bug reports are welcome and likely.

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free