Skip to content

Emacs plugin to run tradeship, which automatically imports JS dependencies and removes unused ones.

Notifications You must be signed in to change notification settings

karthikv/tradeship-emacs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Tradeship for Emacs

Emacs plugin to run tradeship, which automatically imports missing JS dependencies and removes unused ones.

Installation

Ensure you have tradeship installed:

$ npm install -g tradeship
# or use yarn:
$ yarn global add tradeship

Install tradeship-emacs by adding tradeship.el in this repository to your load path. Then, add the following to ~/.emacs:

(require 'tradeship)

Usage

To run tradeship, you may either:

  • Execute M-x tradeship

  • To run on save, add the following to your ~/.emacs:

    (add-hook 'js-mode-hook
              (lambda () (add-hook 'before-save-hook 'tradeship-before-save))))
  • To run using a keyboard shortcut (e.g. ctrl + alt + i), add the following to your ~/.emacs:

    (global-set-key (kbd "C-M-i") 'tradeship)

The first time tradeship runs in a project directory with many JavaScript files, it'll take some time to parse and cache dependencies. Future runs will be much faster.

License

See the comments at the top of tradeship.el.

About

Emacs plugin to run tradeship, which automatically imports JS dependencies and removes unused ones.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published