GitXplorerGitXplorer
j

sublime-js-snippets

public
405 stars
52 forks
7 issues

Commits

List of commits on branch master.
Unverified
b1e081314c34aaf93cec712385aaf61510190853

Merge pull request #19 from cmalard/console

jjprichardson committed 8 years ago
Unverified
17663a4d2561e2c88067dfd5d53d5b58b66b7b18

Added console.info, console.warn

committed 9 years ago
Unverified
fbe9395091be63282254a80906eb7deb58c013b0

Merge pull request #16 from engincancan/master

jjprichardson committed 10 years ago
Unverified
df950d6cb189a0436312748d56e4f9c66fb8d1f5

Added typescript support

eengincancan committed 10 years ago
Unverified
6ce7abbc6e722b35ee0aa261a7b4d18cd275de7b

0.9.0

jjprichardson committed 10 years ago
Unverified
cdc8f5cf55d0f39856edce9cd952899e89ab8a0d

sublime-js-snippets: now using standard javascript

jjprichardson committed 10 years ago

README

The README file for this repository.

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}

[ci] console.info

console.info(${1:msg})${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}

[cw] console.warn

console.warn(${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