Comparing version 0.1.0 to 0.2.0
# ulix changelog | ||
## v0.2.0 | ||
_2021-09-24_ | ||
* `decodeTime` helper | ||
## v0.1.0 | ||
@@ -4,0 +9,0 @@ _2021-06-05_ |
@@ -1,2 +0,2 @@ | ||
export { monotonicFactory, ulid } from "./ulid"; | ||
export { monotonicFactory, ulid, decodeTime } from "./ulid"; | ||
export * from "./types"; |
@@ -13,6 +13,7 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ulid = exports.monotonicFactory = void 0; | ||
exports.decodeTime = exports.ulid = exports.monotonicFactory = void 0; | ||
var ulid_1 = require("./ulid"); | ||
Object.defineProperty(exports, "monotonicFactory", { enumerable: true, get: function () { return ulid_1.monotonicFactory; } }); | ||
Object.defineProperty(exports, "ulid", { enumerable: true, get: function () { return ulid_1.ulid; } }); | ||
Object.defineProperty(exports, "decodeTime", { enumerable: true, get: function () { return ulid_1.decodeTime; } }); | ||
__exportStar(require("./types"), exports); |
{ | ||
"name": "ulidx", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "ULID generator for NodeJS and the browser", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
# ulidx | ||
> ULID generator for NodeJS and the browser | ||
[](https://www.npmjs.com/package/ulidx) | ||
ULID generator library, based off of the original [ulid](https://github.com/ulid/javascript) for NodeJS and the browser. ULIDs are Universally Unique Lexicographically Sortable Identifiers. This library adheres to [this specification](https://github.com/ulid/spec). | ||
@@ -54,2 +56,13 @@ | ||
### Decode ULID Time | ||
Import `decodeTime` to extract the timestamp embedded in a ULID: | ||
```typescript | ||
import { decodeTime } from "ulidx"; | ||
// Extract milliseconds since UNIX Epoch from ULID | ||
decodeTime("01ARYZ6S41TSV4RRFFQ69G5FAV"); // 1469918176385 | ||
``` | ||
## Pseudo-Random Number Generation (PRNG) | ||
@@ -56,0 +69,0 @@ |
14313
221
88