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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@cremadesign/captcha

v4.3.9

Published

This modular javascript plugin inserts a checkbox captcha into the specified form and checks the honeypot, checkbox, and required fields on every field change. If valid, it enables the submit button, adds a form method, and inserts the provided form actio

Downloads

284

Readme

Crema Captcha

I began developing this plugin in 2013 with a simple goal in mind: block spam without annoying users. Your clients don't want to decipher garbled words or play "Find the Storefront". They just want a simple contact form that works. Over several years, this project evolved from a disjointed medly of basic functions into a customizable pure javascript plugin with advanced captcha filters.

NPM Dependencies

Crema Captcha's build process requires NPM, Rollup, and a few plugins. This open-source setup allows us to write newer javascript with modern ES6 features such as import statements and tree-shaking unused functions. Rollup compiles everything to the dist/ directory using the following NPM plugins:

  • Node Resolve Plugin: Allows us to use external ES modules.
  • CommonJS Plugin: Allows us to use external CommonJS modules.
  • Babel Plugin: Transpiles ES6 code to ES5 code older browsers can understand.
  • Uglify: Minifies plugin JS for production.
  • ESLint: Validates syntax and code style.
  • Badwords: An array of obscene words for the profanity filter.
  • Rot: A rotational cipher that obfuscates the badwords array, so it doesn't show up in final output.
  • Replace: Inserts the obfuscated badwords array into our final output.

src/index.js is the main entry point for the JS compile script. So be sure to start there.

How to Build

The compiled JS plus its sourcemap is written to the dist/ directory.

Development

To compile your JS (excl. minification) whenever you make a change to a JS file. This will automatically compile changes to our captcha at captcha.test, but will not be added to Cremastrap.

yarn watch

Production

To compile your JS for production (incl. minification), run:

yarn build

How to Use

Adding it to a website is easy. See the init instructions on the official site: https://captcha.cremadesignstudio.com/

Credits

My build process was heavily inspired by three different build scripts:

  • Rollup Bundle and Watch: This author's recipe was used as the general framework for my setup.
  • Learn Rollup.js Part One: This informative guide explains Babel and the Rollup config more in depth.
  • Bootstrap: Bootstrap's build process introduced me to Rollup and gave me some basic ideas on packaging, such as banner.js and package.json.