The
Module Guide
How to create a module/package/library in any programming language.
The package manager situation can be confusing at the beginning. Most modules are published on npmjs.com, but some are served directly from github.com. To complicate things even further, there are different module systems, which describe how to access the code. Here are three different ways how you can publish your code. If you are doing server-side node.js programming, pick option one (npm plus CommonJS). If you are doing front-end programming, you are encouraged to go with option two (npm plus ES6 modules). Option three (Bower plus browser globals) is simple to use, but disregarded in large parts of the JavaScript community.
- JAVASCRIPT + NPM + COMMON.JS (node.js style)
- JAVASCRIPT + NPM + ES6 MODULES (future positive style)
- JAVASCRIPT + BOWER + BROWSER GLOBALS (almost no package manager style)
You can also go through the struggle (= less time for actual coding) and try to support everything at once. A very detailed description of current JavaScript package managers and module systems can found in this blog arcticle by Nolan Lawsons.
The usual way to publish Ruby modules is using rubygems.org:
While using RSpec is quasi-standard in the Ruby community, minitest is getting more attention lately, and is even bundled in Ruby's standard library.