1.0.3 • Published 2 years ago

oen-uuid v1.0.3

Weekly downloads
-
License
GPL-3.0
Repository
-
Last release
2 years ago

Introduction

安装 (Introduction)

npm install oen-uuid

Loading

加载此模块 (Loading the module)

// CommonJS
const uuid = require('oen-uuid');

// ES Module
import uuid from 'oen-uuid';

如果你想在全局使用 (if you want to use the global)

const uuid = require('oen-uuid');
if (!globalThis.uuid) {
	globalThis.uuid = uuid;
}

Usage

常用APIs (Common Usage)

nextId

const uuid = require('oen-uuid');

let id = uuid.nextId();

console.log(id);

random

Note: 如果random只传一个数字num,则返回 0~num(不包括num)之间的一个随机数字
const uuid = require('oen-uuid');

let rndNum = uuid.random(10);

console.log(rndNum);
Note: 如果random传两个数字num1,num2,则返回 num1~num2(不包括num2)之间的一个随机数字
const uuid = require('oen-uuid');

let rndNum = uuid.random(10,100);

console.log(rndNum);
1.0.3

2 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago