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

slapform

v3.0.2

Published

Easily send submission to Slapform, your favorite form backend service.

Readme

Quick start

1. Create a form

Go to slapform.com/dashboard/forms/new to create your form. Copy the Form ID when you're done.

2. Add to your site

Script tag (no build tools needed):

<script src="https://cdn.jsdelivr.net/npm/slapform@latest/dist/slapform.min.js"></script>
<script>
  var slapform = new Slapform();

  slapform.submit('YOUR_FORM_ID', {
    name: 'Jon Snow',
    message: 'Hello World!',
  })
  .then(function (response) {
    console.log('Success!', response);
  })
  .catch(function (error) {
    console.error('Failed:', error.message);
  });
</script>

NPM:

npm install slapform
// ESM
import Slapform from 'slapform';

// CommonJS
const Slapform = require('slapform');
const slapform = new Slapform({ formId: 'YOUR_FORM_ID' });

const response = await slapform.submit({
  name: 'Jon Snow',
  message: 'Hello World!',
});

HTML form (no JavaScript needed)

You can use Slapform without any JavaScript by pointing your HTML form's action to the API:

<form method="POST" action="https://api.slapform.com/YOUR_FORM_ID">
  <input type="email" name="email">
  <textarea name="message"></textarea>
  <button type="submit">Submit</button>
</form>

API

new Slapform(options)

| Option | Default | Description | |--------|---------|-------------| | formId | '' | Your form ID (also accepts form) | | endpoint | 'https://api.slapform.com' | API endpoint |

slapform.submit(formId?, data, options?)

Submits form data. Returns a promise that resolves with the API response.

  • formId (optional) — Form ID string. Overrides the constructor's formId
  • data — Object with the fields you want to submit
  • options — Optional overrides for formId and endpoint
// Pass formId inline
slapform.submit('YOUR_FORM_ID', { message: 'Hello' });

// Or use the constructor default and just pass data
const sf = new Slapform({ formId: 'YOUR_FORM_ID' });
sf.submit({ message: 'Hello' });

// Override formId via options
sf.submit({ message: 'Hello' }, { formId: 'DIFFERENT_FORM_ID' });

Name triggers

Use special field names to trigger server-side behavior:

slapform.submit('YOUR_FORM_ID', {
  name: 'Jon Snow',
  message: 'Hello World!',
  slap_subject: 'My Favorite Message',
  slap_replyto: '[email protected]',
  slap_debug: false,
  slap_honey: '',
});

See the name trigger documentation for details.

Features

  • Submit data via HTML forms, AJAX, or this npm module
  • Submissions are sent directly to your email
  • Access submissions stored securely for up to 12 months
  • Spam protection
  • Zapier integration

Development

npm start        # Watch mode - rebuilds on file changes
npm run build    # One-time build (ESM, CJS, IIFE)
npm test         # Run tests

Build outputs

| File | Format | Use case | |------|--------|----------| | dist/index.mjs | ESM | import in modern bundlers | | dist/index.js | CJS | require() in Node.js | | dist/slapform.min.js | IIFE (minified) | <script> tag / CDN |

License

MIT