node-snowflake

WebJar for node-snowflake

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

node-snowflake
Last Version

Last Version

0.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

node-snowflake
WebJar for node-snowflake
Project URL

Project URL

https://www.webjars.org
Source Code Management

Source Code Management

https://github.com/Welogix-Tech/node-snowflake

Download node-snowflake

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/node-snowflake/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>node-snowflake</artifactId>
    <version>0.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/node-snowflake/
implementation 'org.webjars.npm:node-snowflake:0.0.1'
// https://jarcasting.com/artifacts/org.webjars.npm/node-snowflake/
implementation ("org.webjars.npm:node-snowflake:0.0.1")
'org.webjars.npm:node-snowflake:jar:0.0.1'
<dependency org="org.webjars.npm" name="node-snowflake" rev="0.0.1">
  <artifact name="node-snowflake" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='node-snowflake', version='0.0.1')
)
libraryDependencies += "org.webjars.npm" % "node-snowflake" % "0.0.1"
[org.webjars.npm/node-snowflake "0.0.1"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

node-snowflake

node-snowflake is a node.js clone for twitter snowflake.

###how to use

//only run simple http server
require('node-snowflake').Server(3001);

//request url example:GET http://localhost:3001/next_id?worker_id={optional}&data_center_id={optional}&sequence={optional}

//response : {"id":"439658373735124992"}


>//only run snowflake nextId
>var snowflake = require('node-snowflake').Snowflake;
>var id = snowflake.nextId(); // use default set
>//or
>//snowflake.init({worker_id : 1, data_center_id : 1, sequence : 0});
>//var id = snowflake.nextId();
>console.log(id);

###see examples/example.js

org.webjars.npm

Versions

Version
0.0.1