Atom Packages Directory

a package directory for a text editor of the 21st Century

Amdbutler

Install with:
    apm install amdbutler
  
OSX Windows
Build Status Build status

AMD Butler Package for Atom

Serving up AMD module imports

An Atom package for managing AMD dependency import statements. It helps you quickly sort, add, and remove AMD import statements. With features such as auto sorting and auto module name discovery it allows you to focus more on your code rather than worrying your AMD imports. This is a port of a plugin with the same name for Sublime Text 3.

Commands

#### amdbutler:sort (alt-s) Sorts the existing AMD imports for the current file alphabetically. Packages are separated by a blank line. The corresponding parameter names are also reordered.

amdbutler:add (alt-a)

Searches your packages for possible imports and displays them in a select list. When an import is selected it is added to the imports for the current file. The imports for the current file are then sorted.

Note: The file that you execute this command from must be a descendant from a folder with a name that matches one of the names in the baseFolders setting.

To prevent duplicate, imports that are already in the current file are excluded from the list.

Argument aliases are usually returned as the file name of the module (e.g. dojo/_base/array => array). However, if the file name is a reserved word in JavaScript the package name is prepended to the beginning of the file name (e.g. dojo/string => dojoString). Preferred argument aliases are also taken into account if they do not follow the standard conventions (PR’s for this file are welcome).

If there is a word under the cursor at the time that this command is invoked it is automatically entered into the selector. This also applies for the remove command.

amdbutler:remove (alt-r)

Displays a select view of all of your current imports. Selecting an import from the quick list removes it from your file. The imports are also automatically sorted.

AMD Format

The minimum amount of code that this tool needs to work on a file is something like this: ```js define([

], function (

) {}); ```

Installation

apm install amdbutler

Settings

Check the settings page for this package from within atom to see available settings.

Contributors

@stdavis
@steveoh
@mokkabonna

Keywords: amd, butler, javascript Suggest keywords
Fork me on GitHub