All Projects → james2doyle → sublime-node-snippets

james2doyle / sublime-node-snippets

Licence: other
A collection of completions/snippets for node.js v8.x

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to sublime-node-snippets

github markdown snippets
GitHub flavored Markdown with plain'ol HTML knowledge! Boom!
Stars: ✭ 23 (+64.29%)
Mutual labels:  snippets, sublime-text-3
Coffeescript Sublime Plugin
Syntax highlighting and checking, commands, shortcuts, snippets, compilation and more.
Stars: ✭ 296 (+2014.29%)
Mutual labels:  snippets, sublime-text-3
network tech
Cisco config syntax and snippets for Sublime Text
Stars: ✭ 82 (+485.71%)
Mutual labels:  snippets, sublime-text-3
Hayaku
Fuzzy abbreviations, support for preprocessors (Sass, Less, Stylus) and a lot of other features in easily configurable set of tools for writing CSS faster
Stars: ✭ 973 (+6850%)
Mutual labels:  snippets, sublime-text-3
pymolsnips
Pymolsnips is a library of PyMOL scripting language code fragments for several popular text editors.
Stars: ✭ 19 (+35.71%)
Mutual labels:  snippets, sublime-text-3
LuaExtended
An improved ST3 Lua syntax definition.
Stars: ✭ 19 (+35.71%)
Mutual labels:  snippets, sublime-text-3
hover-preview
Sublime Text 3 Plugin for previewing images.
Stars: ✭ 42 (+200%)
Mutual labels:  sublime-text-3
js-jsx-snippets
Extensions for React, Redux in JS with babel and ES7 syntax
Stars: ✭ 15 (+7.14%)
Mutual labels:  snippets
IOTA101
IOTA Developer Essentials
Stars: ✭ 38 (+171.43%)
Mutual labels:  snippets
antd-snippets
Ant-Design Snippets for VS Code
Stars: ✭ 37 (+164.29%)
Mutual labels:  snippets
sublime-live-server
🌍️ Launch a Development Server directly from Sublime Text
Stars: ✭ 49 (+250%)
Mutual labels:  sublime-text-3
jquery-course
Code from my Udemy course "The Complete jQuery Course: From Beginner to Advanced"
Stars: ✭ 127 (+807.14%)
Mutual labels:  snippets
competitive-haskell
Snippets for competitive programming in Haskell
Stars: ✭ 23 (+64.29%)
Mutual labels:  snippets
ethereum-scripts
Common useful JavaScript snippets for geth
Stars: ✭ 33 (+135.71%)
Mutual labels:  snippets
EthereumSoliditySnippets
Set of useful snippet for efficiently using SublimeText and the Ethereum Solidity SmartContract programming language.
Stars: ✭ 27 (+92.86%)
Mutual labels:  snippets
VSC-React-Native-React-Redux-Snippets
Snippets for React and React-Native with a bit of Redux for es6/es7 user.
Stars: ✭ 56 (+300%)
Mutual labels:  snippets
TLDR.jl
A package for fast help and snippets
Stars: ✭ 16 (+14.29%)
Mutual labels:  snippets
30-seconds-of-git
Short git snippets for all your development needs
Stars: ✭ 235 (+1578.57%)
Mutual labels:  snippets
competitive-programming-rs
Algorithm Snippets for Competitive Programming in Rust
Stars: ✭ 157 (+1021.43%)
Mutual labels:  snippets
aergia
Vim snippet manager.
Stars: ✭ 31 (+121.43%)
Mutual labels:  snippets

sublime-node-snippets

The majority of snippets for node v8.x. There are 1083 total right now.

Installing

Package Control

Just look for Node Completions on Package Control.

Manual

  • Open the Commands Palette (command+shift+p)
  • Package Control: Add Repository
  • Past in this repos URL
  • Press Enter
  • Open the palette again
  • press enter on "sublime-node-snippets"
  • watch it install

Using

Pressing . (period) will end the snippet lookup.

You will have better results if you pretend the period isn't needed. So if you are looking for fs.readdir, you would type fsread and you would see the results coming up.

Snippet Categories

  • Assertion Testing
  • Buffer
  • Child Processes
  • Cluster
  • Console
  • Crypto
  • DNS
  • Domain
  • Errors
  • Events
  • File System
  • Globals
  • HTTP
  • HTTP/2
  • HTTPS
  • Inspector
  • Modules
  • Net
  • OS
  • Path
  • Performance Hooks
  • Process
  • Punycode
  • Query Strings
  • Readline
  • REPL
  • Stream
  • String Decoder
  • Timers
  • TLS/SSL
  • TTY
  • UDP/Datagram
  • URL
  • Utilities
  • V8
  • VM
  • ZLIB

Building

I went to each page of the node docs, and copied the functions. Then I wrote a converter to take each function and convert it to a snippet.

For Example, this line:

setTimeout(fun, delay)

Is going to get converted to:

setTimeout(${1:fun}, ${2:delay})${0}

When the word callback appears, it will convert it to the standard fun snippet.

fs.readdir(path, callback)

will become

fs.readdir(${1:path}, function(${2:args}){
  ${3:// body}
})${0}

sources.txt

This file is cool. It is just a line-by-line output of the node docs functions. This is the file that is raked over to generate the snippets.

Running The Build

Just run node build.js and it will rake the sources.txt file and then write the new snippet in the snippets folder.

Everything before the first ( will be used as the filename.

Adding New Snippets

Here is how I quickly got all these snippets. I will use Express as an example since it isn't in here.

First I went to the docs for the framework, and I looked to see what the code examples were wrapped in.

For the express docs site, the codes are show in section h3 tags. So to quickly get the list, I ran the following code:

Array.prototype.slice.call(document.querySelectorAll("section h3"), 0).map(function(item){
  return item.textContent.trim();
}).join("\n");

Then copied the output and pasted it in the sources.txt file. Done!

The word callback will automagically be converted into a function.

Contributing

Just add (or edit) a line in the source file. Then run node build.js to generate the new snippets.

License

The MIT License

Copyright (c) 2014 James Doyle [email protected]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].