04-0223239.erer-test 前9个JavaScript代码段库

[Total: 6    Average: 4.8/5]

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.

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. Using a library that not only updates itself but stays up to date with new developments in JS code in general is crucial.

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秒的代码是一个针对新老开发人员的出色项目。 该库基于一个非常简单的概念:您可以在三十秒或更短的时间内理解的摘要。 这是有道理的,因为如果它更复杂,它实际上不是代码段,是吗?

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 p for beginners and an archive of niche snippets.

2.CSS-Tricks

css tricks logo

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

codota logo

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.

Get Codota

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

useful angle

Another library aimed at new devs 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

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

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.


Get Codota


Share this:

javascript

About the author

Ilana is a content writer for the Codota.com blog

Leave a Reply Cancel reply

You must be logged in to post a comment.

from:https://blog.codota.com/top-9-javascript-snippet-libraries/
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值