Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

nodejs snippets and bindings for Sublime Text 2

branch: master

Merge pull request #50 from KrauseStefan/master

Compatibility with Sublime 3
latest commit a97326b3b6
Tane Piper authored April 19, 2014
Octocat-spinner-32 Snippets Moved lang stuff into completion file, moved boilerplate to snippets November 14, 2011
Octocat-spinner-32 lib fix the node.js run broken in Windows. August 31, 2013
Octocat-spinner-32 messages Some dev testing November 16, 2011
Octocat-spinner-32 tools Update uglify_js to use the new API May 27, 2013
Octocat-spinner-32 .gitignore Moving around some files November 14, 2011
Octocat-spinner-32 Context.sublime-menu Organising menus, added keymap November 14, 2011
Octocat-spinner-32 Default (Linux).sublime-keymap Add context filter to "node_run" key binding to avoid conflict with r… October 04, 2012
Octocat-spinner-32 Default (OSX).sublime-keymap Fixed mac keymap November 15, 2011
Octocat-spinner-32 Default (Windows).sublime-keymap Add context filter to "node_run" key binding to avoid conflict with r… October 04, 2012
Octocat-spinner-32 Default.sublime-commands Add npm commands to main menu, add npm publish and search, and uglify… December 17, 2011
Octocat-spinner-32 Main.sublime-menu Add npm commands to main menu, add npm publish and search, and uglify… December 17, 2011
Octocat-spinner-32 Nodejs.message Some dev testing November 16, 2011
Octocat-spinner-32 Nodejs.py Fix: Copy pasted the functions: _output_to_view and scratch in a upda… April 18, 2014
Octocat-spinner-32 Nodejs.sublime-build Fix build - Kill previos node execution February 16, 2013
Octocat-spinner-32 Nodejs.sublime-completions Fixed the completion of exists/existsSync. Is a fs function rather th… July 29, 2013
Octocat-spinner-32 Nodejs.sublime-settings add env variable 'NODE_PATH' to command runtime July 24, 2013
Octocat-spinner-32 Readme.md Fix error in Readme.md July 08, 2013
Octocat-spinner-32 __init__.py Some dev testing November 16, 2011
Octocat-spinner-32 package-metadata.json Update package-metadata.json July 24, 2013
Octocat-spinner-32 package.json Update package.json July 24, 2013
Readme.md

Nodejs Sublime Text 2 Package

PROJECT LOOKING FOR NEW MAINTAINER

Since I started this project, I've not really know where to take it past the initial few versions I released. As such I am no longer maintaining this project - nor do I have the time to look into some of the existing issues.

If anyone would be interested in taking over this project to maintain - and hopefully take it somewhere, then please get in touch.

Overview

The Nodejs Sublime Text 2 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 may install Nodejs via the Sublime Text 2 package manager, or using git with the below commands:

MacOSX

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

Windows

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

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

  • 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

Tane Piper - if you find this plugin useful then please ping me if you would like to donate to my Sublime Text 2 licence fund

Something went wrong with that request. Please try again.