One of my experiments that became crucial to speed up and optimize (preventing a lot of code repetition) the development process of my own projects where I use npm and therefore Node.js (pretty much all the time).
It's a Node.js module, bundled with Webpack, compatible (importable) with any web-based project, due to the fact that it supports all the different formats of modules importing and exporting (CommonJS, AMD, RequireJS, ES6):
import * as myUtilsJS from 'my-utils-js'; // ...const myUtilsJS = require('my-utils-js'); // ...require(['myUtilsJS'], function (myUtilsJS) { // ... });