1.1.1 • Published 4 years ago

mw-username-generator v1.1.1

Weekly downloads
-
License
ISC
Repository
github
Last release
4 years ago

Username Generator

NPM

Introduction

A project to learn how to publish a package on npm. Should be accessible on CLI, Node and on client-size via npm installation or CDN.

Username are created from a random adjective and noun

Output examples

DoubtfulPomegranate ConcernedKiosk SuccessfulShout TastyWit

Installation

npm install mw-username-generator

Usage - Node

const userNameGenerator = require('mw-username-generator');
console.log(userNameGenerator()); //Display a random username

Usage - Browser

You can install and use directly from your working directory or through the following CDN :

UNPKG

<script src='https://unpkg.com/mw-username-generator'></script>

JSDelivr

<script src='https://cdn.jsdelivr.net/npm/mw-username-generator/dist/namegenerator.bundle.min.js'></script>

Access through CDN or local link will create a usernameGenerator function accesible in your script.

Usage - CLI

On your favorite CLI :

npx rand-username

or if package installed globaly

rand-username

Build

To have a working solution on Node and in browser I've used webpack to transpile and bundle my JS files and convert my CJS module to UMD, the following webpack config was used :

const path = require("path");

module.exports = {
  entry: "./namegenerator.js",
  output: {
    path: path.resolve(__dirname, "dist"),
    filename: "namegenerator.bundle.js",
    library: {
      type: "umd", 
      name: "usernameGenerator", //  export name after bundling
    },
    globalObject: "this",
  },
};
1.1.1

4 years ago

1.1.0

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago