/standard-js

JavaScript's version of the Standard Library

Primary LanguageJavaScript

Standard JavaScript Library

Build Status

From https://github.com/christopherliu/standard-js

Mission

Standard-js is designed to add support for the most commonly used functions that are not always supported in every implementation of JavaScript.

Background

A standard library for a programming language is the library that is conventionally made available in every implementation of that language. In some cases, the library is described directly in the programming language specification; in other cases, the contents of the standard library are determined by more informal social practices in the programming community.

-Wikipedia

Most programming languages come with standard libraries. JavaScript does not. Or at least, the one it has is very limited. Why, for example, can't you write this?

var numbersSquared = [3,4,5].map(function(num) { return num*num; });

Well, with CommonJS and JavaScript 1.6, you can. While browser makers (read: IE) work on implementing that and standards committees hash that out, there's this.

We do not want to replace:

  • jQuery/Dojo/ExtJS/Underscore (just get jQuery/Dojo/ExtJS/Underscore)
  • ECMAScript (use polyfills)
  • HTML5 (Modernizr, CSS3PIE and other libraries can help here).

If something is available in one of the major libraries, it's probably best to use it there unless it's something that was used to patch a weakness in JavaScript (some of the jQuery functionality falls into this category).

This is a work in progress.

How to use

Download the full library. Only use the scripts you need. Voila!

Organization

Standard-js is built to be modular - use what you need, throw out what you don't.

  • core/ - core is designed to include primary JS functionality, including JavaScript 1.6
  • browser/ - browser specific code - DOM stuff and the like
  • etc/ - additional functionality

Notes

Addresses with ECMAScript may be blocked by some servers (Apache on Site5 is the only known example). For this reason, use ES.v5 as an alternative spelling. (Note: this is no longer relevant)

Other useful libraries

Here are links to the other stuff I use in many of my projects:

This additional list was everything of use I found on GitHub, last I checked (standard stuff only, no DOM-specific stuff).

TODO

  • Mention compressors
  • Separate polyfill
  • Pick license
  • Update directory list

Contributing to standard-js

StandardJS uses the JSDoc set of conventions, as well as the standard Eclipse/Aptana autoformatting (Ctrl-Shift-F, 80 characters per line).

License

This code is not ready, so a license has not been chosen yet. (Default proprietary).