npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

tokeylic-gen

v1.0.0

Published

ToKeyLic-Gen is a cool library to generate tokens, licenses and much more.

Downloads

50

Readme

ToKeyLic-Gen

ToKeyLic-Gen is a cool library to generate tokens, licenses, keys and much more.

Getting Started

npm install ToKeyLic-Gen

Overview

ToKeyLic-Gen is made to be handfull and available for everyone. Imagine you have an API that needs authentication, well using this module will surelly help you to create simple auth tokens and make your API safe to use.

Key Options

  • keyLenght {Integer} Choose the length of your key

Default: 50 | Example: { keyLenght: 20 } | Content: abcdefghijklmnopqrstuvwxyz

  • useNumbers {Boolean} Add numbers or not to your key

Default: false | Example: { useNumbers: true } | Content: 0123456789

  • useSymbols {Boolean} Add symbols or not to your key

Default: false | Example: { useSymbols: true } | Content: `~!@#$%^&*()–_=+[]{}|;:‘“,./<>?

  • caps {String} Choose between [none | mix | all]

Default: mix | Example: { caps: "all" }

Token Options

You can also add the key options in the same object. (See example)

  • numberOfParts {Integer} Choose the number of parts in your token

Default: 4 | Example: { numberOfParts: 5 }

  • minPartLength {Integer} The minimum length of a part in your token

Default: 3 | Example: { minPartLength: 5 }

  • maxPartLength {Integer} The maximum length of a part in your token

Default: 10 | Example: { maxPartLength: 5 }

  • separator {String} The character that separates the parts in your token

Default: - | Example: { separator: "_" }

  • extras {String} An array of characters which will be added at the end of each part

Default: [] | Example: { separator: ["a", "b", "0", "13"] }

License Options

You can also add the key options in the same object. (See example)

  • useParts {Boolean} Add parts or not to your license

Default: false | Example: { useParts: true }

  • numberOfParts {Integer} Choose the number of parts in your license

Default: 4 | Example: { numberOfParts: 5 }

  • minPartLength {Integer} The minimum length of a part in your license

Default: 3 | Example: { minPartLength: 5 }

  • maxPartLength {Integer} The maximum length of a part in your license

Default: 10 | Example: { maxPartLength: 5 }

  • prefix {String} The prefix that you want to add in the begining of your license

Default: LIC | Example: { prefix: "FREE" }

  • prefixSeparator {String} The character that separates the prefix in your token

Default: - | Example: { prefixSeparator: "_" }

  • partSeparator {String} The character that separates the prefix in your token

Default: _ | Example: { partSeparator: "-" }

  • extras {String} An array of characters which will be added at the end of each part

Default: [] | Example: { separator: ["a", "b", "0", "13"] }

Examples

Key Generation:

Simple Key Generation:

const { Key } = require("tokeylic-gen");

const key = new Key().gen();
console.log(key);

Type: String Example Output: AhfEYSWmuqpdEeLLTeXGGqimRKYeuKjQNOPDfcKsBsWQjZozZc

Customised Key Generation:

const { Key } = require("tokeylic-gen");

const key = new Key({
    keyLenght: 20,
    useNumbers: true,
    useSymbols: true,
    caps: "mix"
}).gen();
console.log(key);

Type: String Example Output: Yb%wG![<rgqr}:PqPX3Ie@Z<kymEAuQWlzcGtQw#SH~Y0IrRaC)

Token Generation

Simple Token Generation:

const { Token } = require("tokeylic-gen");

const token = new Token().gen();
console.log(token);

Type: String Example Output: mbxlJxIUq-SliMAJ-zFjBkOl-uIkoToqPXE)

Customised Token Generation:

const { Token } = require("tokeylic-gen");

const token = new Token({
    keyOptions: {
        useNumbers: true,
        useSymbols: true,
        caps: "mix",
    },
    tokenOptions: {
        numberOfParts: 5,
        minPartLength: 3,
        maxPartLength: 5,
        extras: ["KEYGEN"]
    }
}).gen()
console.log(token);

Type: String Example Output: [<fJKEYGEN-YBa8nKEYGEN-sRK7KEYGEN-qxxkKEYGEN-:<w]KEYGEN)

License Generation

Simple License Generation:

const { License } = require("tokeylic-gen");

const license = new License().gen();
console.log(license);

Type: String Example Output: LIC-vrPhLLGQdsKzQkTSzcGqVTOznJnuTmLjnsWhDZpYRdQUDQOJvB)

Customised License Generation:

const { License } = require("tokeylic-gen");

const license = new License({
    keyOptions: {
        useNumbers: true,
        useSymbols: true,
        caps: "mix",
    },
    licenseOptions: {
        prefix: "KEYGEN",
        partSeparator: "_",
        useParts: true,
        numberOfParts: 5,
        minPartLength: 3,
        maxPartLength: 5,
        extras: ["KEYGEN"]
    }
}).gen()
console.log(license);

Type: String Example Output: KEYGEN-<hQ}KEYGEN_uOPKEYGEN_%yfKEYGEN_=raKEYGEN_P+lbKEYGEN)

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality.

Module License

This module is licensed under MIT license.

Thanks

Made by @TsWin and @matheo-debal with ❤️