npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

fortune-salesforce

v1.0.13

Published

Salesforce adapter for Fortune.

Readme

Fortune Salesforce Adapter

This is a Salesforce adapter for Fortune which makes use of specific Salesforce functionality. Key features include:

  • SOQL building: it interprets arguments from Fortune's adapter interface directly, and generates optimized queries.

To use this adapter, the salesforce user information must be setup prior to attempting to connect.

This adapter, along with Fortune.js, does not implement ORM. This adapter uses jsforce package, and translates the adapter interface directly into SOQL statements that is then passed to jsforce. It is a plain query builder for Salesforce.

Requirements

  • A Salesforce instance and active Salesforce User.

Usage

Install the fortune-salesforce package from npm:

$ npm install fortune-salesforce

Then use it with Fortune:

const fortune = require('fortune')
const salesforceAdapter = require('fortune-salesforce')

const store = fortune({ ... }, {
  adapter: [
    salesforceAdapter,
    {
      // options object
      {
        loginUrl: process.env.SF_LOGIN_URL,
        username: process.env.SF_USERNAME,
        password: process.env.SF_PASSWORD,
        version: process.env.SF_API_VERSION,
        clientId: process.env.SF_CLIENT_ID, // Optional
        clientSecret: process.env.SF_CLIENT_SECRET, // Optional
        redirectUri: process.env.SF_REDIRECT_URI, // Optional
        typeMap: { // Optional
          Accounts: 'Account',
          Cases: 'Case',
          Contacts: 'Contact',
          Opportunities: 'Opportunity',
          OpportunityLineItems: 'OpportunityLineItem',
          Products: 'Product2',
          RecordTypes: 'RecordType',
          Users: 'User'
        },
        relationshipDelimiter: '.' // Optional - Only works with https://github.com/dyno-dev/fortune-json-api
      }
    }
  ]
})

Options

  • loginUrl: Login URL string. Required
  • username:Salesforce username. Required
  • password: Salesforce password (and security token, if available) Required
  • version: Salesforce API Version. Required
  • clientId: Salesforce Client Id.
  • clientSecret: Salesforce Client Secret.
  • redirectUri: Salesforce Redirect URI.
  • typeMap: an object keyed by type name and valued by table name.

Testing

SFDX CLI is required. To setup, run npm run test:setup. This will create the scratch org and print the user details to login. If there is an existing account and entitlement in the new scratch org, you will have to delete the entitlement and then you can run the test scripts.

License

This software is licensed under the MIT License.