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

formtress-js

v0.2.1

Published

A tiny library for managing Formtress forms

Downloads

381

Readme

Formtress.js - A JavaScript library for handling your Formtress forms

npm version

formtress.js is a tiny library that submits your forms using JavaScript, and handles loading states, validation, and error messages.

Features

  • Lightweight: Under 1KB minified and gzipped.
  • Easy to use: Just add a few attributes to your form and you're good to go.
  • Built-in validation: Automatically validates your forms based on the forms you created in Formtress.
  • Error handling: Automatically handles errors and displays them to the user.
  • Platform specific: Built-in integrations for Webflow, with a core module for any project.

Installation

CDN (Webflow)

Add the following script to your Webflow project settings before the closing </body> tag (change latest to the version you want to use):

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/webflow.js"></script>

Note: It's recommended to pin to a specific version in production for stability. Check the version badge above for the current release.

npm

npm install formtress-js

Usage

Webflow

  1. Copy the form ID from your Formtress account.
  2. In Webflow's form settings, set the form Action to your Formtress endpoint:
    https://app.formtress.com/api/f/{your-form-id}
  3. That's it! The script enhances the form progressively:
    • Without JavaScript: the form submits natively to Formtress, keeping it functional for all users.
    • With JavaScript: the submission is intercepted and handled client-side, showing loading states and success/fail panels without a page reload — just like Webflow's native form behaviour.

If you changed the default structure of the error message element, add a data-ft-error attribute to the text element that should display the error message.

Note (v0.2.0 breaking change): The previous data-ft="your-form-id" attribute is no longer used. Set the form action as described above instead.

Core (any project)

Set the form action to your Formtress endpoint so it works without JavaScript:

<form id="my-form" action="https://app.formtress.com/api/f/your-form-id" method="POST">
  <!-- your fields -->
</form>

Then progressively enhance it with JavaScript:

import { submitForm } from 'formtress-js'

const form = document.querySelector('#my-form')
form.addEventListener('submit', async (e) => {
  e.preventDefault()
  const result = await submitForm({
    url: form.action,
    data: new FormData(form),
  })
  if (result.ok) {
    // show success state
  } else {
    // show error state: result.message, result.status
  }
})