Registry / database / innodb-optimized-uuid

innodb-optimized-uuid

JSON →
library1.1.1jsnpmunverified

Generates non-standard UUIDs optimized for fast writes in MySQL InnoDB tables. Current stable version is 1.1.1, released under an MIT license. The library transforms standard UUID v1 values by transposing the time components and removing dashes to create a compact binary(16) format, which reduces index fragmentation and improves insert performance. It is distributed as a single file usable in both Node.js (via npm) and browsers (via Bower or direct script include). Unlike typical UUID generators, it prioritizes database write speed over uniqueness or standard compliance.

npm install innodb-optimized-uuid
INSTALL
IMPORT
SIG · INNODB-OPTIMIZED-U
I
innodb-optimized-uuid
databasejavascriptv1.1.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

innodbOptimizedUuid
var iouuid = require('innodb-optimized-uuid');
import iouuid from 'innodb-optimized-uuid';
CommonJS only; no ES module distribution.
generate
var iouuid = require('innodb-optimized-uuid'); iouuid.generate();
var generate = require('innodb-optimized-uuid').generate; generate();
Direct property access works, but requires correct require.
window.innodbOptimizedUuid
<script src="dist/innodb-optimized-uuid.js"></script> var iouuid = window.innodbOptimizedUuid;
var iouuid = window.innodbOptimizedUuid; // if script not loaded
Browser global exposed only when using the built dist file.

Shows how to generate an InnoDB-optimized UUID in Node.js and browser.

// Node.js var iouuid = require('innodb-optimized-uuid'); var uuid = iouuid.generate(); console.log(uuid); // e.g., '11E4C1F813341CB591E7080027880CA6' // Browser (after including dist file) var iouuid = window.innodbOptimizedUuid; var uuid = iouuid.generate(); console.log(uuid);
Debug
Known issues
gotchaGenerated UUIDs are non-standard and not RFC 4122 compliant; they cannot be compared lexicographically and will not work with standard UUID parsers.
fix
Only use for MySQL InnoDB primary key columns stored as BINARY(16). Do not use in contexts requiring standard UUIDs.
affects: *
gotchaThe library only generates UUIDs from v1 (time-based) values. It does not support modern random (v4) UUIDs or hashed (v5) UUIDs.
fix
If you need v4 or v5, use a dedicated library like 'uuid' and consider alternative indexing strategies.
affects: *
deprecatedThe project's dependency graph shows outdated packages (e.g., gulp, codeclimate) and it has not been updated since 2016. It may contain security vulnerabilities.
fix
Review the codebase for security issues or consider using a maintained alternative.
affects: *
gotchaBower is now deprecated; the browser distribution may not be reliable for modern module bundlers.
fix
For browser use, include the dist file directly or bundle it with your own tooling. For new projects, use npm and a bundler.
affects: *
Errors
Common errors & fixes
Error: Cannot find module 'innodb-optimized-uuid'
Package not installed or not in node_modules.
fix
Run 'npm install innodb-optimized-uuid' in your project root.
ReferenceError: innodbOptimizedUuid is not defined
Browser script not loaded before usage, or wrong global name.
fix
Ensure the script tag for dist/innodb-optimized-uuid.js is added before any usage, and reference window.innodbOptimizedUuid.
TypeError: iouuid.generate is not a function
Incorrect require or import (e.g., using ES module syntax with CommonJS package).
fix
Use 'var iouuid = require('innodb-optimized-uuid');' as the package does not support ES imports.
Upgrade
Version history
1.1.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
innodb-optimized-uuid — npm install innodb-optimized-uuid · libregistry