在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:zenorocha/sublime-javascript-snippets开源软件地址:https://github.com/zenorocha/sublime-javascript-snippets开源编程语言:JavaScript 100.0%开源软件介绍:JavaScript Snippets for SublimeInstallTo install through Package Control, search for JavaScript & NodeJS Snippets. If you still don't have Package Control in Sublime Text, go get it. It's pure awesomeness. If you prefer to install it manually, you can download the package and put it inside your Console[cd] console.dirconsole.dir(${1:obj}); [ce] console.errorconsole.error(${1:obj}); [ci] console.infoconsole.info(${1:obj}); [cl] console.logconsole.log(${1:obj}); [cw] console.warnconsole.warn(${1:obj}); [de] debuggerdebugger; DOM[ae] addEventListener${1:document}.addEventListener('${2:event}', function(e) {
${3}
}); [ac] appendChild${1:document}.appendChild(${2:elem}); [rc] removeChild${1:document}.removeChild(${2:elem}); [cel] createElement${1:document}.createElement(${2:elem}); [cdf] createDocumentFragment${1:document}.createDocumentFragment(); [ca] classList.add${1:document}.classList.add('${2:class}'); [ct] classList.toggle${1:document}.classList.toggle('${2:class}'); [cr] classList.remove${1:document}.classList.remove('${2:class}'); [gi] getElementById${1:document}.getElementById('${2:id}'); [gc] getElementsByClassName${1:document}.getElementsByClassName('${2:class}'); [gt] getElementsByTagName${1:document}.getElementsByTagName('${2:tag}'); [ga] getAttribute${1:document}.getAttribute('${2:attr}'); [sa] setAttribute${1:document}.setAttribute('${2:attr}', ${3:value}); [ra] removeAttribute${1:document}.removeAttribute('${2:attr}'); [ih] innerHTML${1:document}.innerHTML = '${2:elem}'; [tc] textContent${1:document}.textContent = '${2:content}'; [qs] querySelector${1:document}.querySelector('${2:selector}'); [qsa] querySelectorAll${1:document}.querySelectorAll('${2:selector}'); Loop[fe] forEach${1:myArray}.forEach(function(${2:elem}) {
${3}
}); [fi] for infor (${1:prop} in ${2:obj}) {
if (${2:obj}.hasOwnProperty(${1:prop})) {
${3}
}
} Function[fn] functionfunction ${1:methodName}(${2:arguments}) {
${3}
} [afn] anonymous functionfunction(${1:arguments}) {
${2}
} [pr] prototype${1:ClassName}.prototype.${2:methodName} = function(${3:arguments}) {
${4}
} [iife] immediately-invoked function expression(function(${1:window}, ${2:document}) {
${1}
})(${1:window}, ${2:document}); [call] function call${1:methodName}.call(${2:context}, ${3:arguments}) [apply] function apply${1:methodName}.apply(${2:context}, [${3:arguments}]) [ofn] function as a property of an object${1:functionName}: function (${2:arguments}) {
${3}
} JSON[jp] JSON.parseJSON.parse(${1:obj}); [js] JSON.stringifyJSON.stringify(${1:obj}); Timer[si] setIntervalsetInterval(function() {
${2}
}, ${1:delay}); [st] setTimeoutsetTimeout(function() {
${2}
}, ${1:delay}); NodeJS[ase] assert.equalassert.equal(${1:actual}, ${2:expected}); [asd] assert.deepEqualassert.deepEqual(${1:actual}, ${2:expected}); [asn] assert.notEqualassert.notEqual(${1:actual}, ${2:expected}); [me] module.exportsmodule.exports = ${1:name}; [pe] process.exitprocess.exit(${1:code}); [re] requirerequire('${1:module}'); BDD[desc] describedescribe('${1:description}', function() {
${2}
}); |