{"id":17419936,"url":"https://github.com/bendrucker/firebase-auto-ids","last_synced_at":"2025-04-15T00:03:04.274Z","repository":{"id":27747324,"uuid":"31235255","full_name":"bendrucker/firebase-auto-ids","owner":"bendrucker","description":"Generate random time-based IDs like Firebase","archived":false,"fork":false,"pushed_at":"2019-08-04T12:55:57.000Z","size":11,"stargazers_count":9,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-15T00:02:38.569Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bendrucker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-23T23:17:10.000Z","updated_at":"2022-05-28T14:11:33.000Z","dependencies_parsed_at":"2022-09-03T05:11:01.342Z","dependency_job_id":null,"html_url":"https://github.com/bendrucker/firebase-auto-ids","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendrucker%2Ffirebase-auto-ids","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendrucker%2Ffirebase-auto-ids/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendrucker%2Ffirebase-auto-ids/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendrucker%2Ffirebase-auto-ids/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bendrucker","download_url":"https://codeload.github.com/bendrucker/firebase-auto-ids/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248981260,"owners_count":21193146,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-17T02:36:50.298Z","updated_at":"2025-04-15T00:03:04.239Z","avatar_url":"https://github.com/bendrucker.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# firebase-auto-ids [![Build Status](https://travis-ci.org/bendrucker/firebase-auto-ids.svg?branch=master)](https://travis-ci.org/bendrucker/firebase-auto-ids) [![Greenkeeper badge](https://badges.greenkeeper.io/bendrucker/firebase-auto-ids.svg)](https://greenkeeper.io/)\n\nGenerate random time-based, collision-proof IDs a la [`Firebase.push`](https://www.firebase.com/docs/web/api/firebase/push.html). Designed for testing and education (readability), not performance.\n\n## Installing\n\n```sh\n$ npm install firebase-auto-ids\n```\n\n## API\n\n##### `generate(now)` -\u003e `String`\n\nfirebase-auto-ids exports a function. Pass in `now`, the current timestamp (e.g. `Date.now()`). `generate` returns an ID string. Like `Firebase.push`, IDs hold the following properties:\n\n* `id1` \u003c `id2` where `id1` was created at an earlier time (`now`) than `id2`\n* `id1` \u003c `id2` where `id1` and `id2` were created at the same `now` but `generateAutoId` was executed for `id1` before `id2`\n* `id1` !== `id2` where `id1` and `id2` were created at the same `now` in different clients\n\n\u003chr\u003e\n\n##### `new generate.Generator()` -\u003e `generator`\n\nCreates a new `generator` instance. Individual instances do not share state. This means that IDs created at the same time in a given runtime will no longer be determined by call order. \n\n##### `generator.generate(now)` -\u003e `String`\n\nSame as [`generate(now)`](#generatenow---string)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbendrucker%2Ffirebase-auto-ids","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbendrucker%2Ffirebase-auto-ids","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbendrucker%2Ffirebase-auto-ids/lists"}