jashkenas/coffeescript

Docs: Document best practice for creating a small NPM module

Open

#4.693 aberto em 9 de set. de 2017

Ver no GitHub
 (5 comments) (4 reactions) (0 assignees)CoffeeScript (1.980 forks)batch import
help wanted

Métricas do repositório

Stars
 (16.577 stars)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

Description

When creating a small npm package for something like strscan, what is the modern/CS2/best-practices way to structure the repo? I'm looking for something that has a small Cakefile and src, lib, and tests directories (if those are recommended).

For example, Sam Stephenson's CoffeeScript based strscan package from 2010 looks like this:

Yet, we're 7 years later with many updates to Node, NPM, and now CoffeeScript. Would someone be able to provide a modern best-practices repo for building a simple package that could be included from other CoffeeScript or JS code simply using require 'some-package'?

If so, it might be nice to have a small reference to this in the official documentation.

Thanks!

Guia do colaborador