Stitch is a library that simplifies the packaging of CommonJS modules for use in the browser. It allows developers to write modular JavaScript code using the CommonJS format and then bundles it into a single file that can be served client-side. This helps bridge the gap between Node.js-style development and browser environments, particularly before modern bundlers like Browserify and Webpack became widespread. The library automatically resolves dependencies, inlines modules, and ensures they can be required in the browser as if they were running in Node.js. It was designed to encourage clean modular design in front-end applications and reduce reliance on global variables. Stitch is lightweight and intended for developers who want a simple way to bundle JavaScript modules without a lot of configuration overhead.
Features
- Enables development with CommonJS modules in Node.js
- Bundles modules together to create a single browser-compatible script
- Supports organizing code using lib/ and vendor/ paths
- Integrates seamlessly with frameworks like Express.js for serving content
- Simplifies moving server-side code to client-side execution
- Repository is archived and read-only as of June 2018