Top 9 JavaScript Snippet Libraries

in #dev5 years ago

 When developing a program in JavaScript (or any language, for that matter) you will often find yourself choosing between DIY code and existing code snippets to do what you need. Being able to find the snippet you need when you need it can save you a lot of time and prevent those JavaScript writing headaches.

But where should you start looking? If your answer is “Google” then you should really keep reading, as we’re about to save you a lot of precious hours of scrolling through search results.

Disclaimer: This article was written by yours truly and originally published on the blog of Codota, a cool startup bringing AI to your IDE.

The Haystack Overflow

Trying to find the code snippet you need with Google, or even searching GitHub gists, shared GitLab snippets, and (of course) StackOverflow is literally like trying to find a needle in a haystack. Even if you have advanced Google-Fu skills, the snippets you will find in these vast haystacks of code will not necessarily come with proper commenting or documentation. In fact, it might not run at all and just cost more in terms of time and energy invested.

The solution? An arsenal of curated JavaScript snippet libraries and repositories you can save and customize. To help you boost that arsenal we’ve collected nine of the best websites and free repositories full of useful JavaScript snippets and micro-frameworks to use in your projects.

The Best JavaScript Snippet Libraries

There’s no shortage of personal and public collections of JavaScript snippet libraries online. However, many are outdated, hard to search or limited to a specific tool or application in the form of a plugin package. Our list includes curated libraries that started out as personal collections, ones meant as learning tools for new programmers, and smart searchable databases of code snippets in community maintained open source projects.

1.30 Seconds of Code

30 Second of Code is a fantastic project aimed at both new and seasoned developers. This library is based on a very simple concept: snippets you can understand in thirty seconds or less. Which makes sense because if it’s more complex it’s not really a snippet, is it?

With hundreds of useful snippets neatly organized by category and properly tagged, frequent updates and an engaged community, this library is a great resource to have. It even includes a special section for beginners and an archive of niche snippets.

2.CSS-Tricks

Don’t let the name and URL fool you – this library of snippers offers quite a few useful ones. All curated by Chris Coyier, this list may not offer a large selection, but it’s probably one of the most visually pleasing websites linked in this post.

3.Codota

As the creators of a smart AI coding assistant, Codota’s library excels in both selection and intelligent search capabilities. With a vast database of thousands of lines of codes, finding the snippet you need is surprisingly easy.Though it is not manually curated, this library makes up for it with a pleasant UI, IDE integration and the sheer volume of useful code snippets.

4.Code to go

Aimed mostly at beginners, Code to go provides a limited number of very basic code snippets. However, it but brings added value to those looking to learn and not just copy and paste.

5.Snippetlib

Another personal collection that had become a public library is Snippetlib. It holds a fairly extensive searchable collection of snippets in various programming languages and is curated by Jessie Frazelle.

6.Useful Angle

Another library aimed at devs new is Useful Angle, with a frequently updated list of well documented and thoroughly explained code snippets. Built more like a blog than a proper library for code snippets, it’s nearly impossible to find anything useful without the Google angle.

7. Snipplr

Established way back in 2006, Snipplr serves two functions: a website to save and share your snippets, and a huge library of 63173 snippets (not all of them JavaScript, of course) at the time of writing. It’s fairly easy to search using the advanced search function to narrow down results.

8. Codepen

Somewhat similar to Snipplr, Codepen offers a more polished UI, some brilliant copywriting (check out the topic descriptions), and quite a lot of code snippets to make your app work and look pretty. In addition to the library, Codepen features, among others, a radio show and job listings.

9. Microjs

This collection of micro-frameworks and snippets is organized in one single page, which can take forever to scroll. Fortunately, the helpful search function on the top of the page can guide you toward the right file to download.

(source: https://twitter.com/xmrtni/status/846942114659389450)

If you can’t find the code snippet you seek in any of these repositories, it’s time to default back to Google and hope someone somewhere was kind enough to write the snippet you need. Then, if your search is taking too long, you have no choice but to be the hero for others. Write it, test it, and be sure to share it on one or more of the repositories above to do the next dev to need it a huge time-saving favor.
-=-=-=-

Top 9 JavaScript Snippet Libraries was originally published on the Codota blog and is copied here since I wrote it and got permission.

Sort:  

Love & !BEER

Hi, @techslut!

You just got a 0.05% upvote from SteemPlus!
To get higher upvotes, earn more SteemPlus Points (SPP). On your Steemit wallet, check your SPP balance and click on "How to earn SPP?" to find out all the ways to earn.
If you're not using SteemPlus yet, please check our last posts in here to see the many ways in which SteemPlus can improve your Steem experience on Steemit and Busy.

I have a question for you Ilana: Are you Eyal Katz? https://blog.codota.com/author/eyal/
Im asking because in the Codota blog it says that guy is the author of this article.

Not exactly. Eyal Katz is my editor and the person paying me to write these. Some of the posts go under his name mostly for technical reasons. If need be, I can bother him into digging up his old Steem password to come here and confirm. :)

You can see the ones with my name here: https://blog.codota.com/author/ilana/

This is strange, so you are an author there in codota too, and that post clearly and unequivocally states he is the author, so in my view either you are plagiarizing, or he is plagiarizing, are you saying he is plagiarizing your work with your consent? or are you saying you are commiting forgery with his consent? Or could we call it ghostwriting to be kinder perhaps?

Or it would simply look weird if all the posts in the blog were by the same author. This is very common practice in corporate blogs and I've written on behalf of at least a dozen CEOs in my career as a content writer.

Either way, why does this matter? I have explicit permission to publish these, there's a link back to the origin and I would like to believe I have enough of a reputation here on Steem to not be suspected as a plagiarist.

Ok, so it looks like consensual forgery then.
We dont trust anybody, we verify, please have him verify you wrote it.
If you are his ghostwriter, thats ok.

Now I am curious: who is this "we"?

"We" is the Jaguar Force cleaning team, which is an anonymous team for operational security reasons, also,
in general "we" is the cleaning community, cleaners verify, dont trust or leave issues up to faith. I hope you can understand that is the nature of our work, if not once people build a certain rep they could get away with anything.

Honestly? I don't see this as a good enough reason to bother Eyal. Whoever you are, you are wasting your time and mine. Want to flag me? Have at it. The post is here for SEO reasons and I was already paid for writing it so... whatever.

Hi @techslut!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your UA account score is currently 7.094 which ranks you at #66 across all Steem accounts.
Your rank has not changed in the last three days.

In our last Algorithmic Curation Round, consisting of 192 contributions, your post is ranked at #32.

Evaluation of your UA score:
  • Your follower network is great!
  • The readers appreciate your great work!
  • Good user engagement!

Feel free to join our @steem-ua Discord server

We have verified with Eyal that you are actually the author of the article, he has changed the original article to reflect this.
We apologize for the inconvenience. Upvoted.

Be sure to check my previous post. Did I really grow those tomatoes? You must investigate and harass random people to be sure!!!!

So you're a self-proclaimed anonymous steemcleaners wannabe going around bothering people to... what? Get authors like me to switch to publish0x / voice / hyperspace? Because it's working. If I didn't have friends and a following here, your little "inconvenience" would have driven me away from Steem. How many authors have you harassed into leaving?

You are making the retention problem worse by chasing users away with your makeshift content police. But considering your anonymity, I won't be surprised you're actually doing this purposefully to drive users away. Sad.

Coin Marketplace

STEEM 0.16
TRX 0.15
JST 0.028
BTC 54274.36
ETH 2279.16
USDT 1.00
SBD 2.33