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

node-sfdc-deploy

v0.0.5

Published

Deploys a project to Salesforce as a static resource

Readme

Salesforce Deploy Tool

A simple utility that compresses a project into a static resource and deploys it to Salesforce using jsforce.

Install

npm install --save-dev node-sfdc-deploy

This will install sfdc-deploy to node_modules/.bin/sfdc-deploy.

Usage

package.json scripts

Add the following scripts to your package.json:

"scripts": {
  ...
  "compile": "<your build command>",
  "predeploy": "npm run compile",
  "deploy": "sfdc-deploy --build-dir <build output directory> --deploy-dir <defaults to deploy>"
  ...
}

Now you can run the following command to kick off your deployment:

npm run deploy

gulp.js

I haven't tested this, but it should work.

var sfdcDeploy = require('sfdc-deploy');

gulp.task('deploy', ['build'], function(){
  return sfdcDeploy.run({
    buildDir: 'build',
    deployDir: 'deploy'
  });
});

Options

Usage: sfdcDeploy [options]

  Options:

    -h, --help                                    output usage information
    -u, --username [username]                     Salesforce username
    -p, --password [password]                     Salesforce password
    -l, --login-url [loginUrl]                    Salesforce login-url
    -d, --build-dir [buildDir]                    location of directory to be compressed into a static resource
    -o, --deploy-dir [deployDir]                  location of deployment directory
    -c, --config-file [configFile]                location of config json
    -v, --verbose [verbose]                       verbose output
    -s, --no-prompt [noPrompt]                    Do not prompt for credentials
    --resource-name [resourceName]                Static Resource name (defaults to name in package.json)
    --resource-description [resourceDescription]  Static Resource description (defaults to description in package.json)
    --poll-interval [pollInterval]                JSForce poll-interval
    --poll-timeout [pollTimeout]                  JSForce poll-timeout
    --skip-deploy [skipDeploy]                    creates the static resource, but does not depoy to Salesforce
    -V, --version                                 output the version number

Notes

Deploy Directory Merge

sfdc-deploy will attempt to merge the static resource into your deploy directory. Suppose you have a deploy directory that looks like this:

deploy
  src
    pages
      myPage.page
    staticresources
      file1.resource
      file1.resource-meta.xml
  package.xml

After running the depoy command you will have a deploy directory that looks like this:

deploy
  src
    pages
      myPage.page
    staticresources
      file1.resource
      file1.resource-meta.xml
      myPackage.resource
      myPackage.resource-meta.xml
  package.xml

This means it is safe to use your Salesforce project directory as your deploy directory. Note however that the deploy operation will attempt to deploy your entire project, and not just the single static resource. If you have another means of deploying your static resource then you can always use the --skip-deploy flag. This will create the static resource and skip the deployment steps.

Config File

sfdc-deploy accepts a config file in json format. By default it will look for a file called sfdcDeploy.json. However you can always specify another file with the --config-file flag.

Example:

{
  "resourceName": "ilovelamp",
  "resourceDescription": "Do you really love the lamp, or are you just saying it because you saw it?",
  "verbose": true,
  "pollInterval": 1000,
  "pollTimeout": 10000,
  "loginUrl": "https://login.salesforce.com",
  "username": "[email protected]",
  "password": "bythebeardofzeus",
  "noPrompt": true,
  "deployDir": "deploy",
  "buildDir": "build",
  "skipDeploy": false
}