Comparing version 0.0.0-dev to 0.0.1
{ | ||
"name": "typeid-js", | ||
"version": "0.0.0-dev", | ||
"version": "0.0.1", | ||
"description": "Official implementation of the TypeID specification in TypeScript. TypeIDs are type-safe, K-sortable, and globally unique identifiers inspired by Stripe IDs", | ||
"keywords": [ | ||
"typeid", | ||
"uuid", | ||
"uuidv7", | ||
"guid" | ||
], | ||
"homepage": "https://github.com/jetpack-io/typeid-js", | ||
"bugs": "https://github.com/jetpack-io/typeid-js/issues", | ||
"license": "Apache-2.0", | ||
"author": { | ||
"name": "jetpack.io", | ||
"email": "opensource@jetpack.io" | ||
}, | ||
"repository": "github:jetpack-io/typeid-js", | ||
"sideEffects": false, | ||
@@ -8,2 +23,9 @@ "main": "./dist/index.js", | ||
"types": "./dist/index.d.ts", | ||
"exports": { | ||
".": { | ||
"require": "./dist/index.js", | ||
"import": "./dist/index.mjs", | ||
"types": "./dist/index.d.ts" | ||
} | ||
}, | ||
"files": [ | ||
@@ -10,0 +32,0 @@ "dist/**" |
@@ -1,7 +0,4 @@ | ||
# TypeID TS | ||
### Official JavaScript implementation of [TypeIDs](https://github.com/jetpack-io/typeid) using TypeScript. | ||
# Official TypeID-JS Package | ||
### JavaScript implementation of [TypeIDs](https://github.com/jetpack-io/typeid) using TypeScript. | ||
This is the official TypeScript package for TypeIDs written by jetpack.io (authors of the | ||
original TypeID spec). | ||
TypeIDs are a modern, **type-safe**, globally unique identifier based on the upcoming | ||
@@ -12,10 +9,28 @@ UUIDv7 standard. They provide a ton of nice properties that make them a great choice | ||
This particular implementation provides an npm package that can be used by any JavaScript | ||
or TypeScript project. | ||
This is the official JavaScript / TypeScript implementation of TypeID by the | ||
[jetpack.io](https://jetpack.io) team. It provides an npm package that can be used by | ||
any JavaScript or TypeScript project. | ||
# Library Usage | ||
# Installation | ||
Using npm: | ||
```bash | ||
npm install typeid-js | ||
``` | ||
Using yarn: | ||
```bash | ||
yarn add typeid-js | ||
``` | ||
Using pnpm: | ||
```bash | ||
pnpm add typeid-js | ||
``` | ||
# Usage | ||
To create a random TypeID of a given type, use the `typeid()` function: | ||
```typescript | ||
import { typeid } from 'typeid-ts'; | ||
import { typeid } from 'typeid-js'; | ||
const tid = typeid("prefix"); | ||
@@ -28,3 +43,3 @@ ``` | ||
```typescript | ||
import { typeid } from 'typeid-ts'; | ||
import { typeid } from 'typeid-js'; | ||
const tid = typeid(); | ||
@@ -38,3 +53,3 @@ ``` | ||
```typescript | ||
import { TypeID } from 'typeid-ts'; | ||
import { TypeID } from 'typeid-js'; | ||
@@ -46,3 +61,3 @@ const tid = TypeID.fromString("prefix_00041061050r3gg28a1c60t3gf); | ||
```typescript | ||
import { TypeID } from 'typeid-ts'; | ||
import { TypeID } from 'typeid-js'; | ||
@@ -56,6 +71,6 @@ const tid = TypeID.fromUUID("prefix", "00000000-0000-0000-0000-000000000000"); | ||
+ `toString()`: Encodes the object as a string, using the canonical format | ||
+ `asUUID()`: Decodes the TypeID into a UUID string in hex format. The type prefix is ignored | ||
+ `asUUIDBytes()`: Decodes the TypeID into a UUID byte array. The type prefix is ignored | ||
+ `toUUID()`: Decodes the TypeID into a UUID string in hex format. The type prefix is ignored | ||
+ `toUUIDBytes()`: Decodes the TypeID into a UUID byte array. The type prefix is ignored | ||
+ `fromString(str)`: Parses a TypeID from a string | ||
+ `fromUUID(prefix, uuid)`: Creates a TypeID from a prefix and a UUID in hex format | ||
+ `fromUUIDBytes(prefix, bytes)`: Creates a TypeID from a prefix and a UUID in byte array format | ||
+ `fromUUIDBytes(prefix, bytes)`: Creates a TypeID from a prefix and a UUID in byte array format |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No License Found
License(Experimental) License information could not be found.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
193774
33
0
2572
1
1
72
2