Our open-source building blocks for JavaScript apps, published on npm. Each package can be used on its own, or install 'mcode-package' to collect them all into a single 'mcode.' namespace: mcode.log(), mcode.swap(), mcode.isJson(), and more, as if they came from one package.
Replaces console.log() with mcode.log(), mcode.warn(), mcode.error(), mcode.exp(), and others that have severity built into the call. Every event is time-stamped, tagged with its source module, and colorized, objects are shown as pure data, and exceptions include a stack dump or trace, in the Browser console or on the Server.
Consistent data handling for large, extensible apps: type checking and type coercion for strings, numbers, JSON, HTML, dates, and time stamps, plus safe nested properties, defaults, ID generation, encoding, case conversion, and HTTP status helpers. No dependencies.
List processing that is more flexible than a standard Dictionary. mcode.swap() uses any list as 'keys' and any other list of the same size as 'values', and mcode.call() uses a key to call a function from a list. Lists work in either direction and replace long switch statements with data.
Namespaced Node.js and Redis caching with consistent key construction for files, data structures, and app values. Typed values, transactions, geo and sorted sets, and pub/sub, with in-memory or Redis namespaces side by side.
Every package follows our MicroCODE coding style: consistent, explicit, simple, and readable. Each one is documented with JSDoc, tested with Jest, and used every day in our own apps. Get them all with one command:
npm install mcode-package