Snippets for JavaScript / JS Programming in Sublime Text 2
Switch branches/tags
Nothing to show
Pull request Compare This branch is 34 commits behind jprichardson:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
CHANGELOG.md
README.md
bdd.describe.sublime-snippet
bdd.ita.sublime-snippet
bdd.its.sublime-snippet
vanilla.console_dir.sublime-snippet
vanilla.console_log.sublime-snippet
vanilla.console_log_util_inspect.sublime-snippet
vanilla.function.sublime-snippet
vanilla.function_anonymous.sublime-snippet
vanilla.module_exports.sublime-snippet
vanilla.process_exit.sublime-snippet
vanilla.prototype.sublime-snippet
vanilla.require.sublime-snippet

README.md

Sublime Text Editor 2 - JavaScript Snippets

JavaScript / JS snippets for your Sublime Text 2 Fu.

Install

Sublime Text 2 - Package Control

Install via package control: http://wbond.net/sublime_packages/community Search for JavaScript Snippets or typically the keywords js or javascript are suitable.

Mac OS X

git clone git://github.com/jprichardson/sublime-js-snippets.git ~/Library/Application Support/Sublime Text 2/Packages/JavaScript

Linux

git clone git://github.com/jprichardson/sublime-js-snippets.git ~/.config/sublime-text-2/Packages/JavaScript

Windows

git clone git://github.com/jprichardson/sublime-js-snippets.git %userprofile%\AppData\Roaming\Sublime Text 2\Packages\JavaScript

Vanilla Snippets

[afn] anonymous function

function(${1:arguments}) {
  ${0:// body...}
}

[cl] console.log

console.log(${1:msg})${0}

[cli] console.log with util.inspect

console.log(require('util').inspect(${1:obj}, true, ${2:10}, true))${0}

[cd] console.dir

console.dir(${1:obj})${0}

[fn] function

function ${1:methodName} (${2:arguments}) {
  ${0:// body...}
}

[me] module.exports

module.exports = ${1}

[pe] process.exit

process.exit()

[proto] prototype

${1:ClassName}.prototype.${2:methodName} = function(${3:arguments}) {
  ${0:// body...}
}

[req] require

require('${1:package}')${0}

Behaviorial Driven Development

[desc] describe

describe('${1:description}', function() {
  ${0:// body...}
})

[ita] asychronous it

it('${1:description}', function(done) {
  ${0:// body...}
  done()
})

[its] synchronous it

it('${1:description}', function() {
  ${0:// body...}
})

Author

JP Richardson

License

Copyright 2012, JP Richardson jprichardson@gmail.com

MIT