Skip to content

Commit

Permalink
Merge pull request #1 from oramasearch/chore/package-names-links
Browse files Browse the repository at this point in the history
chore: update for forking
  • Loading branch information
matijagaspar authored Oct 18, 2024
2 parents 768d132 + 236acda commit a866cf2
Show file tree
Hide file tree
Showing 8 changed files with 5,685 additions and 13,941 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Node.js CI

on:
push:
branches: ['main']
pull_request:
types: [opened, synchronize]

jobs:
build:
name: Build and Test
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 2

- uses: pnpm/action-setup@v2
with:
version: latest

- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'pnpm'

- name: Install dependencies
run: pnpm install --no-frozen-lockfile

- name: Test
run: pnpm test
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,5 @@ yarn-error.log*

# vercel
.vercel

.vscode
7 changes: 0 additions & 7 deletions .travis.yml

This file was deleted.

1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
MIT License

Copyright (c) 2022 Eric Elliott
Copyright 2023 OramaSearch Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
This is a fork of https://github.com/paralleldrive/cuid2

Only change is removing use of literal BigInt notation `n`.

# Cuid2

Secure, collision-resistant ids optimized for horizontal scaling and performance. Next generation UUIDs.
Expand All @@ -24,17 +28,17 @@ Need unique ids in your app? Forget UUIDs and GUIDs which often collide in large
## Getting Started

```
npm install --save @paralleldrive/cuid2
npm install --save @orama/cuid2
```

Or

```
yarn add @paralleldrive/cuid2
yarn add @orama/cuid2
```

```js
import { createId } from '@paralleldrive/cuid2';
import { createId } from '@orama/cuid2';

const ids = [
createId(), // 'tz4a98xxat96iws9zmbrgj3a'
Expand All @@ -48,7 +52,7 @@ Using Jest? Jump to [Using with Jest](#using-in-jest).
### Configuration

```js
import { init } from '@paralleldrive/cuid2';
import { init } from '@orama/cuid2';

// The init function returns a custom createId function with the specified
// configuration. All configuration properties are optional.
Expand All @@ -74,7 +78,7 @@ console.log(
### Validation

```js
import { createId, isCuid } from '@paralleldrive/cuid2';
import { createId, isCuid } from '@orama/cuid2';


console.log(
Expand Down Expand Up @@ -210,7 +214,7 @@ Different use-cases have different needs for entropy resistance. Sometimes, a sh
By default, you'd need to generate `~4.0268498e+18` ids to reach a 50% chance of collision, and at maximum length, you'd need to generate `~6.7635614e+24` ids to reach 50% odds of collision. To use a custom length, import the `init` function, which takes configuration options:

```js
import { init } from '@paralleldrive/cuid2';
import { init } from '@orama/cuid2';
const length = 10; // 50% odds of collision after ~51,386,368 ids
const cuid = init({ length });
console.log(cuid()); // nw8zzfaa4v
Expand Down
Loading

0 comments on commit a866cf2

Please sign in to comment.