New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@code-coaching/random

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@code-coaching/random

This package provides functions to generate random stuff (strings, numbers, uuid). It can be used as a dependency for other packages. It can be used as a CLI tool.

latest
npmnpm
Version
1.2.2
Version published
Maintainers
1
Created
Source

Code Coaching - Random

This package provides functions to generate random stuff (strings, id, uuid). It can be used as a dependency for other packages. It can be used as a CLI tool.

Prerequisites

  • Node.js
  • npm

Usage

As a CLI tool

Using npx to print out all possible options:

npx @code-coaching/random --help

Inside of a project

npm install @code-coaching/random

Examples

import { randomUUID } from "../dist/index.js";
// This will be: import { randomUUID } from "@code-coaching/random"; inside of a project.

console.log(randomUUID()); // This will generate a random UUID, e.g. b2c58d7e-f91a-4bc6-a5e6-25aa1ba0f573
import { randomID } from "../dist/index.js";
// This will be: import { randomID } from "@code-coaching/random"; inside of a project.

console.log(randomID()); // This will generate a random ID of length 8.
console.log(randomID(4)); // This will generate a random ID of length 4.
console.log(randomID(100)); // This will generate a random ID of length 100.
import { randomString } from "../dist/index.js";
// This will be: import { randomString } from "@code-coaching/random"; inside of a project.

console.log(randomString()); // Generates a random string of length 8.
console.log(randomString(4)); // Generates a random string of length 4.
console.log(randomString(100)); // Generates a random string of length 100.

FAQs

Package last updated on 06 Feb 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts