micro-timestamp is a lightweight Node.js package that generates UTC microsecond timestamps in MySQL datetime format (YYYY-MM-DD HH:MM:SS.ffffff). Current stable version 2.1.0 relies on the microtime library for high-resolution microsecond precision. It automatically adjusts for system timezone offset to ensure UTC correctness. Simpler than alternatives like moment.js for this specific use case, but has no TypeScript support and limited ecosystem adoption.
npm install micro-timestampNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows CommonJS require, calling the function with no arguments, and example output with microsecond granularity.
If you depend on the previous ISO format, either pin to version 1.x or manually transform the output.
Ensure build essentials are installed (e.g., on Ubuntu: sudo apt-get install build-essential python3). Alternatively, use a fallback timestamp library without native dependencies.
Verify system timezone is correct (e.g., use `date` command). The package does no timezone database lookups; it assumes the system's offset is accurate.
Consider switching to a native implementation using process.hrtime.bigint() and converting to microseconds.
Run 'npm install micro-timestamp' in your project directory.
Use 'const microTimestamp = require('micro-timestamp');' without curly braces.Use CommonJS require() or configure your bundler to handle CommonJS modules. Do NOT use import.