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

@_kyletan/sftoolkit

v1.0.6

Published

Here's a README.md for the provided JavaScript code:

Readme

Here's a README.md for the provided JavaScript code:

Salesforce Data Management Utilities

This module provides utilities for handling CSV and JSON data interactions with Salesforce. It includes functions for converting CSV to JSON, performing bulk inserts into Salesforce, running anonymous Apex scripts, and creating CSV files from JSON data.

Prerequisites

  • Node.js (version 14 or higher)
  • Salesforce CLI (sf command installed and configured with Salesforce org aliases)

Import

  • Import methods similar to below or reference this code: https://github.com/jkyletan/nodePhDreamin2025
import {getJsonDataFromCsv, createCsvFileFromJson, bulkInsertToSalesforce} from '@_kyletan/sftoolkit'

Functions

getJsonDataFromCsv(filePath)

  • Description: Converts a CSV file to JSON format.
  • Parameters:
    • filePath: Path to the CSV file.
  • Returns: A Promise that resolves to an array of JSON objects.

bulkInsertToSalesforce(filePath, sObject, orgAlias)

  • Description: Performs a bulk insert into Salesforce using the Salesforce CLI.
  • Parameters:
    • filePath: Path to the CSV file to be imported.
    • sObject: The Salesforce object to insert into.
    • orgAlias: Alias for the Salesforce org to interact with.
  • Returns: A Promise that resolves with the result of the bulk insert operation.

runAnonymousApexScript(filePathOfApexScript, orgAlias)

  • Description: Executes an anonymous Apex script in Salesforce.
  • Parameters:
    • filePathOfApexScript: Path to the Apex script file.
    • orgAlias: Alias for the Salesforce org where the script will run.
  • Returns: A Promise that resolves with the execution results.

createCsvFileFromJson(jsonData)

  • Description: Converts JSON data to a CSV file.
  • Parameters:
    • jsonData: JSON data to convert to CSV.
  • Returns: A Promise that resolves with the name of the newly created CSV file.

insertJsonDataToSalesforce(jsonData, sObject, orgAlias)

  • Description: Converts JSON data to CSV and then performs a bulk insert into Salesforce.
  • Parameters:
    • jsonData: JSON data to insert into Salesforce.
    • sObject: The Salesforce object to insert into.
    • orgAlias: Alias for the Salesforce org to interact with.
  • Returns: A Promise that resolves with the result of the bulk insert operation.

Usage

Here's how you might use these functions:

const { getJsonDataFromCsv, bulkInsertToSalesforce, runAnonymousApexScript, createCsvFileFromJson, insertJsonDataToSalesforce } = require('./path-to-your-file');

// Example: Reading CSV and inserting into Salesforce
getJsonDataFromCsv('path/to/your/file.csv')
  .then(json => insertJsonDataToSalesforce(json, 'Account', 'myOrgAlias'))
  .then(result => console.log('Insertion Result:', result))
  .catch(err => console.error('Error:', err));

// Example: Running an anonymous Apex script
runAnonymousApexScript('path/to/your/apexScript.apex', 'myOrgAlias')
  .then(result => console.log('Apex Execution Result:', result))
  .catch(err => console.error('Error:', err));

// Example: Creating a CSV from JSON
createCsvFileFromJson([{name: 'John Doe', age: 30}])
  .then(fileName => console.log('CSV file created:', fileName))
  .catch(err => console.error('Error:', err));

Notes

Ensure your Salesforce CLI is set up correctly with the appropriate org aliases. The time-stamp package is used for generating unique file names based on the current timestamp. Error handling is implemented using Promises for asynchronous operations. The code assumes that the Salesforce CLI (sf) commands are available in the PATH.