ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Js​Modules

by luwes ST2/ST3

JsModules is a Sublime Text Plug-in to convert CJS modules to ES modules.

Details

Installs

  • Total 90
  • Win 48
  • OS X 24
  • Linux 18
Nov 12 Nov 11 Nov 10 Nov 9 Nov 8 Nov 7 Nov 6 Nov 5 Nov 4 Nov 3 Nov 2 Nov 1 Oct 31 Oct 30 Oct 29 Oct 28 Oct 27 Oct 26 Oct 25 Oct 24 Oct 23 Oct 22 Oct 21 Oct 20 Oct 19 Oct 18 Oct 17 Oct 16 Oct 15 Oct 14 Oct 13 Oct 12 Oct 11 Oct 10 Oct 9 Oct 8 Oct 7 Oct 6 Oct 5 Oct 4 Oct 3 Oct 2 Oct 1 Sep 30 Sep 29
Windows 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2
OS X 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 2 0 1 1 0 0 0 0 0 0
Linux 0 0 1 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

JsModules

[JsModules] is a Sublime Text Plug-in to convert CJS modules to ES modules.

Installation

[JsModules] is compatible with both Sublime Text 2 and 3, and all supported Operating Systems.

Requirements

  • [Sublime Text] - Text editor for code
  • [node.js] - JavaScript runtime
  • [yarn] or [npm] - Package manager for JavaScript
  • [cjs-to-es6] - CLI to convert JavaScript files from CommonJS to ES6 modules

Install cjs-to-es6

If you installed [cjs-to-es6] globally (using the [yarn] or [npm] command below), there's nothing else you need to do.

# using yarn:
yarn global add cjs-to-es6

# using npm:
npm install -g cjs-to-es6

Install JsModules via Package Control

The easiest and recommended way to install Js​Modules is using [Package Control].

From the main application menu, navigate to:

  • Tools -> Command Palette... -> Package Control: Install Package, type the word JsModules, then select it to complete the installation.

Install JsModules Manually

  1. Download and extract Js​Modules [zip file] to your [Sublime Text Packages directory].
  2. Rename the extracted directory from SublimeJsModules-master to JsModules.

Default Sublime Text Packages Paths:

  • OS X: ~/Library/Application Support/Sublime Text [2|3]/Packages
  • Linux: ~/.Sublime Text [2|3]/Packages
  • Windows: %APPDATA%/Sublime Text [2|3]/Packages

NOTE Replace the [2|3] part with the appropriate Sublime Text version for your installation.

Usage

To run the JsModules command… open the Sublime Text Command Palette (super + shift + p) and type JsModules: Convert file to ES module.