npm install my-snowflake-id-generator
Then
const SnowflakeGenerator = require('my-snowflake-id-generator');
const generator = new SnowflakeGenerator(1, 1);
// Generate a numeric ID of length 16
console.log(generator.generateId(16));
// Generate a hexadecimal ID of length 16
console.log(generator.generateId(16, true));
now you can use this package's snowflake id in your project.