render-id

1.0.3 • Public • Published

render-id

Converts a string pattern to a string by replacing all the '#' to '0' after replacing the next counter number.

Example 1

const renderId = require('render-id');
renderId.render('TES#######',12);
 
// output : TES0000012

Example 2

const renderId = require('render-id');
renderId.render('XYZ#####99##',1234);
 
// output : XYZ000129934

Example 3

const renderId = require('render-id');
renderId.render('ABC##99##',123456);
 
// output : ABC12993456

Example 4

const renderId = require('render-id');
renderId.render('${FY-IN}/##99##',123456);
 
// output : 2019-2020/12993456

Supported Fiscal Years

Syntax Description
${FY-IN} Indian Fiscal Year
${FY-GB} United Kingdom Fiscal Year
${FY-US} United States Fiscal Year

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i render-id

      Weekly Downloads

      7

      Version

      1.0.3

      License

      MIT

      Unpacked Size

      5.35 kB

      Total Files

      4

      Last publish

      Collaborators

      • jugnuagrawal