sublime-js-snippets

Snippets for JavaScript / JS Programming in Sublime Text 2 & 3

  • Owner: jprichardson/sublime-js-snippets
  • Platform:
  • License::
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

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

Main metrics

Overview
Name With Ownerjprichardson/sublime-js-snippets
Primary Language
Program language (Language Count: 0)
Platform
License:
所有者活动
Created At2012-11-14 17:35:51
Pushed At2017-07-14 19:15:43
Last Commit At2017-07-14 14:15:43
Release Count3
Last Release Name0.9.0 (Posted on 2015-03-17 13:24:25)
First Release Name2013_02_01 (Posted on 2013-02-01 05:14:35)
用户参与
Stargazers Count406
Watchers Count24
Fork Count52
Commits Count48
Has Issues Enabled
Issues Count10
Issue Open Count3
Pull Requests Count5
Pull Requests Open Count4
Pull Requests Close Count4
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private