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 🙏

© 2025 – Pkg Stats / Ryan Hefner

snowflake-promise

v5.0.1

Published

A Promise-based, TypeScript-friendly helper for the Snowflake SDK

Readme

snowflake-promise npm node

A modern, Promise-based interface for the Snowflake Node.js SDK with full TypeScript support.


Promise Support for the Snowflake SDK

Quick Start

Why use it?

The official Snowflake SDK uses a callback-based API, which can be difficult to manage in modern JavaScript applications. It leads to code that’s hard to understand and hard to maintain.

Promises and async/await are the modern replacement for callbacks. snowflake-promise provides a lightweight adapter that adds Promise support to the SDK's callback-based methods, making it easy to work with Snowflake in Node.js.

Features

  • Works with the official Snowflake Node.js SDK
  • Adds Promise support to callback-based methods
  • Allows you to use async/await for cleaner, more readable code
  • Fully backward compatible with existing (callback-based) code that uses the Snowflake SDK
  • Supports all authentication methods: username/password, MFA, key pair, OAuth
  • Supports all Snowflake SDK features, including streaming large result sets
  • Modern ESM/CJS dual package support
  • Built with 100% test coverage

Basic Usage

snowflake-promise provides a lightweight adapter for the Snowflake Node.js SDK. Pass a Snowflake SDK Connection object to the promisifyConnection function, and it will be enhanced with full Promise support.

Here's a simple example of how to use snowflake-promise to connect to Snowflake, execute a query, and handle the results:

import snowflakeSdk from "snowflake-sdk";
import { promisifyConnection } from "snowflake-promise";

async function main() {
  // Create a connection
  const connection = snowflakeSdk.createConnection({
    account: "<account name>",
    username: "<username>",
    password: "<password>",
    database: "SNOWFLAKE_SAMPLE_DATA",
    schema: "TPCH_SF1",
    warehouse: "DEMO_WH",
  });

  // ✨ Promisify the connection
  const promisifiedConnection = promisifyConnection(connection);

  // Connect (no callbacks -- you can use async/await)
  await promisifiedConnection.connect();

  // Execute a query (no callbacks)
  const { resultsPromise } = promisifiedConnection.execute({
    sqlText: "SELECT COUNT(*) FROM CUSTOMER WHERE C_MKTSEGMENT=:1",
    binds: ["AUTOMOBILE"],
  });

  // Get the results (no callbacks)
  const rows = await resultsPromise;
  console.log(rows);
}

main();

See the Full Documentation for details on: