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

active-input

v0.3.2

Published

Form and input fields live feedback with character counters and form events.

Downloads

11

Readme

Active Input

Add a live feedback and character counter to your input elements and forms

Enable submit button on form data change, enable button only when minimum number of characters has been typed in textarea element.

Demo: jsfiddle

<div class="liveInput">
	<input class="text" type="text">
	<span class="counter"></span>
	<button type="button">Save</button>
</div>

Now that we have HTML, we initialize the plugin:

$('.liveInput').activeInput({
	minChars:  5,
	counter: $('.liveInput .counter')
});

After initialization. If input element has less then 5 characters, button will be disabled. If you enter more then 4 characters, button will be enabled.

If activeInput has been applied to other elements such as select or input checkbox, then plugin will be looking if the element value has been changed since initialization.


Options

minChars: 1 (default) Numer of characters that has to be in input element or textarea to enable a button.

stripHtml: false (default). Do not count html tags in an input.

button: null (default). Which button has to be enabled/disabled on input update.

counter: null Element where activeInput will display number of characters. Counter is based on: current length - minChars. So, if we set minimum characters as 512, it'll show -512 on empty input.

form: false (default). Listen to form data update. If anything's been changed, button will be enabled. Form elements must have name attributes.

input: null || jQuery element || array of input elements. Indicate which element is being tracked by activeInput. If set to null, plugin will look for the first input || textarea element in the element it's been applied to. If set to jQuery object, it'll listen to this element's update. Could be set to multiple elements. If set to array, then that array must have the following structure:

[{
	input: $(inputElement),
	minChars: 1,
	maxChars: null,
	counter: $(counterElement),
	stripHtml: false
}]