nodejs snippets and bindings for Sublime Text 3
Python JavaScript
Clone or download
varp Merge pull request #85 from varp/master
Bringing new functionality
Latest commit 0b5e683 Jan 9, 2018
Permalink
Failed to load latest commit information.
Snippets Moved lang stuff into completion file, moved boilerplate to snippets Nov 14, 2011
lib fix(nodejs_base): use self.__class__.__name__ for derived classes com… Jan 9, 2018
messages feat(plugin): new release 2.0.3 Jan 9, 2018
tests feat(plugin): kill only Nodejs processes started by plugin, not all i… Dec 14, 2017
tools fix(completions): fix issue #61 and #69 Oct 11, 2017
.gitignore feat(ci): enable debug plugin in travis Nov 8, 2017
.no-sublime-package Fixed issue #63 Jun 3, 2017
.nvmrc fix(nvm): update Nodejs version up to 8.6.0 in .nvmrc Oct 12, 2017
.travis.yml feat(plugin): new release 2.0.3 Jan 9, 2018
Context.sublime-menu Organising menus, added keymap Nov 14, 2011
Default (Linux).sublime-keymap Add context filter to "node_run" key binding to avoid conflict with r… Oct 4, 2012
Default (OSX).sublime-keymap Fixed mac keymap Nov 15, 2011
Default (Windows).sublime-keymap Add context filter to "node_run" key binding to avoid conflict with r… Oct 4, 2012
Default.sublime-commands feat(gui): use edit_settings command for user settings and user key b… Aug 20, 2017
LICENCE.md Added licence May 30, 2014
Main.sublime-menu feat(gui): use edit_settings command for user settings and user key b… Aug 20, 2017
Nodejs.py fix(project): ci: set NVM_SYMLINK_CURRENT; nvm now use NVM_SYMLINK_CU… Nov 8, 2017
Nodejs.sublime-build working on the issue #60 Apr 30, 2017
Nodejs.sublime-completions fix(lib): typos Dec 1, 2017
Nodejs.sublime-settings fix(settings): fix typo in default settings - output_to_new_tab Oct 12, 2017
Readme.md test commit counting on GitHub contribution graph Dec 5, 2017
__init__.py feat(lib): imporve and refactor the code; phase number 2 Aug 20, 2017
appveyor.yml feat(plugin): new release 2.0.3 Jan 9, 2018
dependencies.json feat(plugin): kill only Nodejs processes started by plugin, not all i… Dec 14, 2017
messages.json feat(plugin): new release 2.0.3 Jan 9, 2018
package.json feat(plugin): new release 2.0.3 Jan 9, 2018
unittesting.json fix(tests): update unittesting.json Nov 2, 2017

Readme.md

Nodejs Sublime Text 3 Package Build Status Build status

Overview

The Nodejs Sublime Text 3 Package provides a set of code completion, scripts and tools to work with nodejs.

Code Completion

The package code completion is generated from the main nodejs libraries and global namespaces. To invoke the code completion start typing the namespace you want (For example, type fs) and then Ctrl + Space, you get this:

A picture of the file system context menu

Node Commands

You can access node commands in two ways.

  • Via the menu in Tools -> Node
  • By accessing the Command Palette and typing node

The current commands available are (with Windows binding, other bindings are provided):

  • Run current script in node (Alt + R)
  • Run current script in node debug (Alt + D)
  • Run current script in node and arguments (Ctrl + Alt + r)
  • Run current script in node debug and arguments (Ctrl + Alt + D)
  • Uglify Code
  • NPM Command
  • Build documentation (builds the completion files)

Snippets

Also included are some boilerplate snippets. They include functionality such as a http server, reading the contents of a directory, etc.

To access these snippets type node in your editor followed by Ctrl + Space

If you have any boilerplate code you would like to see in here, get in touch.

Install

You can install this package from Sublime Text 3 package manager. Also you can install this package manually:

MacOSX

`git clone https://github.com/tanepiper/SublimeText-Nodejs.git ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/Nodejs`

Windows

`git clone https://github.com/tanepiper/SublimeText-Nodejs "%APPDATA%\Sublime Text 3\Packages\Nodejs"`

Linux

`git clone https://github.com/tanepiper/SublimeText-Nodejs $HOME/.config/sublime-text-3/Packages/Nodejs`

After the package is installed, install Node.js packages needed for working the package built-in tools. You can to install either globaly by: npm install -g commander@"~2.9.0" uglify-js@"~2.6.0" or localy by adding previously mentioned Node.js packages to your current project, either: npm install commander@"~2.9.0" uglify-js@"~2.6.0" or manully editing your project package.json file.

PLEASE NOTE: When your installed Node.js packages (previously mentioned) globaly, you also need to set the package node_path setting. For that, go to the Preferences -> Package Settings -> Nodejs -> Settings User.

Build Systems

PLEASE NOTE: The build system will be refactored to provide different nodejs build systems (such as jake)

If you have a JavaScript file open, by selecting Tools -> Build Systems -> Nodejs and then hitting Ctrl + B, you will activate the node build system on your file and node will try to run it. You may need to add a path variable to the settings object for this if your node executable is not found

TODO

  • uglify_js.js and other ./tools/*.js scripts dosen't work when the package is installed by SublimeText package manager
  • Use events API to install NodeJs dependicies for tools provided by the package
  • Refactor plugin's classes inheritance in Nodejs.py
  • Use events API to generate Sublime Text completions during installation phase depending on a version of installed NodeJs
  • Check for nvm installation
  • Replace the Nodejs.sublime-build to work with jake
  • Reorganise menu structure
  • Improve code completion snippets where possible
  • Provide an interface for writing JavaScript plugins

Author & Contributors

The original author of this package Tane Piper. At the time the project maintainer is Vardan Pogosian.