Wondering what’s next for npm?Check out our public roadmap! »

    TypeScript icon, indicating that this package has built-in type declarations

    1.0.3 • Public • Published

    Salesforce Convert ID

    npm version

    Before the Salesforce API v2.5 we had both formats of ID lengths which can sometimes lead to some problems. This library aims to converts a 15 character Salesforce ID to a 18 characters Salesforce ID to address this issue.

    How to use it

    • Install the library first with yarn add @adriantombu/salesforce-convert-id
    • And then import it in your script
    const { salesforceConvertId } = require('@adriantombu/salesforce-convert-id')
    const smallId = 'a0i1t000002i0p0';
    const longId = salesforceConvertId(smallId)

    In case of an invalid ID, we juste send it back with no warning as this is not the purpose of this library

    const { salesforceConvertId } = require('@adriantombu/salesforce-convert-id')
    const aWrongId = 'badid';
    const longId = salesforceConvertId(aWrongId)

    How to contribute

    • Clone the repository git clone git@github.com:adriantombu/salesforce-convert-id.git
    • Install the packages with yarn install
    • Modify the src/index.ts file
    • When everything's done, you can send a PR \o/


    npm i @adriantombu/salesforce-convert-id

    DownloadsWeekly Downloads






    Unpacked Size

    7.83 kB

    Total Files


    Last publish


    • avatar