Binstubs are just scripts that can be executed directly:
bin/testas opposed tosh bin/test- @brandondees
Imperative convenience scripts Used conjunctively to automate declarative actions. Could potentially be used on "User Land" applications in the near future.
The following script will clone repository and install developer dependencies
$ git clone https://github.com/devpunks/snuggsi.git
$ cd snuggsi && npm iIf you need support for windows file an issue with this link appended to description.
bin/
browsebundlecompilecompresscovercrankdeploydistributeintegratelintpackagepublishserveshrinksnuggsistyletesttranspilewatchweighversion
$ bin/browse [root]Executes the following step process (in parallel):
serve- Launch BrowserSync
watch
root- (optional) path to serve from/(Defaults to.current directory)
PORT- Server port (Defaults to 3000)BROWSER_PORT- Browser port (Defaults to next available port after serverPORTi.e. 3001 whenPORT=3000)
$ bin/bundleSimple cat script for appending standalone ECMASCript modules into a single file.
$ bin/compileCompiles distribution into a tiny little file. Executes the following step process (in order of appearance):
$ bin/compressCompression routine used for
Content-Encoding
negotiation.
Supports
brotli (.br),
gzip (.gz),
& deflate (.zo)
Content Encoding tokens
$ bin/coverUses
nyc
$ bin/crankExecutes the following step process (in order of appearance):
$ bin/deployPushes repository to Δ Vercel hosting service.
$ bin/distributeUsed to mark distributions of library upstream on Github
$ bin/integrateHook used for Travis CI continuous integration. This is typically ran after pushes to Github branches.
See .travis.yml for more details.
$ bin/lint [file]Performs lint check on code in specified file.
Uses JSStandard
path- (optional) Specific file to run lint check. (Defaults todist/snuggsi.es)
$ bin/package🚧 This algorithm will be implemented to minify distribution. (i.e. Tree Shaking)
- Packaging components
- Containerizing components
- Tree Shaking
- Dead Code Elemination
- MDN Tree Shaking
- Dead Code Elemination During Bundling
- Docker Containerization
- Dockerizing a Node.js Web App
$ bin/publishPublishes static assets (i.e. examples, markup, styles, & scripts)
$ bin/serve [root]Launches web server with root as main entry point.
PORT- Server port (Defaults to 80)
root- (optional) path to serve from/(Defaults to.current directory)
$ bin/shrinkRun uglify-js and uglify-es along with minification
$ snuggsi [command]Main entry point for snuggsi CLI (Command Line Interface).
The help menu will display if no command is provided.
See list of optional commands above
NODE_PATH- OverrideNODE_PATHglobal location (See Loading from the global folders Node documentation)
$ bin/style [component-directory | style-file.{sss,css}]Please see style#readme for details.
$ test [path]Run test suite or specify an optional entry point to test.
path- (optional) Specific test directory or file. (Defaults to run entire test suite)
$ bin/transpile [input] [output]Run Buble for transpilation from ECMAScript to Javascript
input- (optional) path (Defaults to dist/snuggsi.es)output- (optional) path (Defaults to dist/snuggsi.js)
$ bin/watch [directory]Watch base directory for changes to markup, styles, and scripts.
directory- (optional) path to watch for changes (Defaults to current directory.)
$ bin/weigh [library]Routine to validate overall weight of library.
Validate snuggsi.min.es.br is within
one Ethernet frame
(1500 OCTETS).
library- (optional) path to watch for changes (Defaults todist/snuggsi.min.es.br)
- https://gist.github.com/branneman/8775568
- https://gist.github.com/branneman/8048520
- https://stackoverflow.com/q/10265798/determine-project-root-from-a-running-node-js-application
- NODE_PATH on Heroku https://lostechies.com/derickbailey/2014/02/20/how-i-work-around-the-require-problem-in-nodejs
$ bin/versionUsed to mark revisions of library upstream on Github and npm.
NOTE: A chronological CalVer strategy is used instead of SemVer.
# Tools
npm edit <pkg>[/<subpkg>...]
npm explore some-dependency
npm test
# Pull Request version
npm version prerelease# Automated Daily
# sign-git-tag to prevent infinite recursion
# ignore-scripts to prevent infinite recursion
npm version patch --tag=dev --sign-git-tag --ignore-scripts \
-m "⏰ %s CalVer Daily Patch Dev Release"
npm publish --tag=dev# Automated Monthly
npm ls
npm outdated
npm update --also=dev
npm prune
npm dedupe
npm rebuild
npm update
npm pack
npm issues # Github issues
npm version minor --tag=latest -m "⏰ %s CalVer Monthly Minor Release"
npm publish --tag=latest# Automated Yearly
npm whoami
npm owner
npm org devpunks ls
npm token
npm config
npm doctor
npm audit # Cleanup npm packages
npm ci
npm version major --tag=stable -m "⏰ %s CalVer Annual Major Release"
npm shrinkwrap # https://docs.npmjs.com/cli/v6/configuring-npm/package-locks
npm deprecate <pkg>[@<previous-year-version>] <message>
npm publish --tag=stable