Build and publish your first NPM package in 15 minutes.

Let’s get started!

What is NPM?

Requirements

Steps to building a package

{
"name": "@mdenic/uniqid",
"version": "1.0.0",
"description": "A super simple unique id based on timestamp.",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/markoDenic/uniqid.git"
},
"keywords": [
"uniqid"
],
"author": "Marko Denic",
"license": "MIT",
"bugs": {
"url": "https://github.com/markoDenic/uniqid/issues"
},
"homepage": "https://github.com/markoDenic/uniqid#readme"
}
module.exports = module.exports.default = function(prefix, suffix) {
var time = Date.now();
return (prefix || '') + time.toString() + (suffix || '');
};
# @mdenic/uniqid

[![npm (scoped)](https://img.shields.io/npm/v/@mdenic/uniqid.svg)](https://www.npmjs.com/package/@mdenic/uniqid)
[![npm bundle size (minified)](https://img.shields.io/bundlephobia/min/@mdenic/uniqid.svg)](https://www.npmjs.com/package/@mdenic/uniqid)

A super simple, lightning fast unique id based on the current timestamp in milliseconds, with optional prefix and suffix.

## Install

```
$ npm install @mdenic/uniqid
```

## Usage

```js
var uniqid = require("@mdenic/uniqid");

uniqid();
//=> "1558604880081" //string

uniqid('hello-');
//=> "hello-1558604880081" //string

uniqid('', '-world');
//=> "1558604880081-world" //string

uniqid('hello-', '-world');
//=> "hello-1558604880081-world" //string

```
/.idea
git init
git add .
git commit -m "initial commit"
git remote add origin https://github.com/MarkoDenic/uniqid.git
git push -u origin master

It’s alive! :) 🚀

Further reading

★ Senior Full Stack Developer ★ https://markodenic.com/