Snippets for JavaScript / JS Programming in Sublime Text 2 & 3
Latest commit fbe9395 Jun 18, 2015 @jprichardson Merge pull request #16 from engincancan/master
Added typescript support
Permalink
Failed to load latest commit information.
CHANGELOG.md 0.9.0 Mar 17, 2015
README.md sublime-js-snippets: now using standard javascript Mar 17, 2015
bdd.describe.sublime-snippet Added typescript support Jun 18, 2015
bdd.ita.sublime-snippet Added typescript support Jun 18, 2015
bdd.its.sublime-snippet Added typescript support Jun 18, 2015
vanilla.console_dir.sublime-snippet Added typescript support Jun 18, 2015
vanilla.console_error.sublime-snippet Added typescript support Jun 18, 2015
vanilla.console_log.sublime-snippet Added typescript support Jun 18, 2015
vanilla.console_log_util_inspect.sublime-snippet Added typescript support Jun 18, 2015
vanilla.console_trace.sublime-snippet Added typescript support Jun 18, 2015
vanilla.function.sublime-snippet Added typescript support Jun 18, 2015
vanilla.function_anonymous.sublime-snippet Added typescript support Jun 18, 2015
vanilla.iife.sublime-snippet Added typescript support Jun 18, 2015
vanilla.module_exports.sublime-snippet Added typescript support Jun 18, 2015
vanilla.object_keys_foreach.sublime-snippet Added typescript support Jun 18, 2015
vanilla.process_exit.sublime-snippet Added typescript support Jun 18, 2015
vanilla.prototype.sublime-snippet Added typescript support Jun 18, 2015
vanilla.require.sublime-snippet Added typescript support Jun 18, 2015
vanilla.setinterval.sublime-snippet Added typescript support Jun 18, 2015
vanilla.settimeout.sublime-snippet Added typescript support Jun 18, 2015
vanilla.use_strict.sublime-snippet Added typescript support Jun 18, 2015

README.md

Sublime Text Editor 2 / 3 - JavaScript Snippets

JavaScript / JS snippets for your Sublime Text 2 / 3 Fu.

Install

Sublime Text 2 / 3 - 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. You can install manually be cloning into your Sublime package directory.

Vanilla Snippets

[afn] anonymous function

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

[cd] console.dir

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

[ce] console.error

console.error(${1:error})${0}

[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}

[ct] console.trace

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

[fn] function

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

[ii] Immediately-invoked function expression

(function () {
    ${0:// body...}
})();

[me] module.exports

module.exports = ${1}

[okfe] Objects.keys and forEach

Object.keys(${1:obj}).forEach(function (key) {
    ${0:// body...}
})

[pe] process.exit

process.exit()

[proto] prototype

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

[req] require

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

[sto] setTimeout

setTimeout(function () {
    ${2:// body...}
}, ${1:millis})

[sti] setInterval

setInterval(function () {
    ${2:// body...}
}, ${1:millis})

[us] use strict

'use strict'

Behaviorial Driven Development

[desc] describe

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

[ita] asychronous it

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

[its] synchronous it

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

JavaScript Style

js-standard-style

Uses JavaScript Standard Code Style. Read the rules here.

License

Copyright 2012-2015, JP Richardson jprichardson@gmail.com

MIT