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

webflow-scripts

v1.1.0

Published

Various scripts to be used to extend functionality of websites built with Webflow

Readme

Webflow Scripts

Scripts

Hubspot Submit

A form controller script that overrides the default Webflow form behavior to submit form data to Hubspot via API. It will target ALL forms on a page that have the required attributes, and will ignore forms that don't have the required attributes so that other forms can retain default behavior if desired.

IMPORTANT

  • The field types and names must match the Hubspot form fields exactly.
  • email property in Hubspot must have corresponding input with name email in Webflow.
  • Properties other that Contact Properties use dot notation: company.name, company.industry, etc.
  • Install the Hubspot tracking code on the site to attribute submissions with the Hubspot cookie.
  • It is highly recommended to turn off non-Hubspot form captures for all forms in Hubspot to avoid duplicate submissions. Manage Settings Docs
Currently Supported Field Types

These are the tested field types that are supported. More field types are planned to be supported in future versions with backward compatibility.

  • Text Inputs - including text, phone, email, number
  • Text Areas
  • Checkboxes
  • Selects (native select elements - not dropdowns)

Usage

<script
  data-webflow-hubspot-submit
  data-use-ip="false"
  data-use-utm="false"
  data-use-gclid="false"
  src="https://cdn.jsdelivr.net/npm/webflow-scripts@<VERSION>/dist/hubspot-submit/index.js"
></script>

=1.1.0 (or latest version)

Script Tag

PLACE IN GLOBAL FOOTER | OR | PLACE IN PAGE FOOTER (if per page usage)

The script embed should have the following attribute to work as expected: data-webflow-hubspot-submit.

The script embed has the following OPTIONAL flags:

  • data-use-ip [true | false] (default: false) - If true, the script will attempt to get the client IP and add to the Hubspot context.
  • data-use-utm [true | false] (default: false) - If true, the script will attempt to get the UTM parameters from the URL and add to the Hubspot context. NOTE: The form in Hubspot must have identical utm fields to be collected, otherwise the submission data will be noisy.
  • data-use-gclid [true | false] (default: false) - If true, the script will attempt to get the GCLID parameter from the URL and add to the Hubspot context. NOTE: The form in Hubspot must have identical gclid field to be collected, otherwise the submission data will be noisy.

Webflow Form Block

The Webflow form block includes a wrapper with a form element, success block, and error block. It also includes a class w-form which is the selector used for default behavior. This script will remove the class in preparation for the custom behavior - therefore, don't style the wrapper using that selector.

Required Attributes

= Form Element =

(NOT THE FORM BLOCK, but the form element itself)

  • data-hs-portal-id - The Hubspot portal ID. (found on the script embed code from Hubspot)
  • data-hs-form-id - The Hubspot form ID. (found on the script embed code from Hubspot)

= Form Success Block =

It will be set to display: block when the form is successfully submitted, therefore style the inner elements accordingly.

  • data-form-success - Success block target.

= Form Error Block =

It will be set to display: block when the form submission fails, therefore style the inner elements accordingly.

  • data-form-error - Error block target.

Optional Attributes

= Redirects =

Applied to form element.

  • data-redirect-url - The URL to redirect to after successful form submission. (e.g. /thank-you)
  • data-redirect-timeout - The number of milliseconds to wait before redirecting. (e.g. 1000 = 1 second) - default is 0 if a redirect URL is provided without a timeout.

= Resource Downloads =

Applied to form element.

  • data-resource-url - The URL to download a resource after successful form submission. These can be PDFs uploaded to the Webflow Assets library, for example.
  • data-resource-filename - The filename of the resource to download. This is the name that will be used when the browser prompts the user to save the file. (e.g. "whitepaper.pdf")
  • NOTE: if a resource URL is provided but a filename is not, the resource will open a new browser tab to the resource URL instead.

Hello World

A script that logs "Hello, world!" to the console. Helpful for testing CDN fetches.

<script src="https://cdn.jsdelivr.net/npm/webflow-scripts@<VERSION>/dist/hello-world/index.js"></script>