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

angular-trustpass

v0.4.0

Published

A simple password strength meter and validator inspired by MailChimp's signup form.

Downloads

12

Readme

Angular Trustpass

The trusty password security checklist.

This is a simple password strength meter & validator inspired by MailChimp's signup form.

See demo

Screenshot

Done by folks at Trustroots.org

install

You can install this package either with npm or with bower.

npm

npm install angular-trustpass --save

Then add trTrustpass as a dependency for your app:

angular.module('demoApp', ['trTrustpass']);

bower

bower install angular-trustpass --save

Add <script> and <link> to your page:

<link rel="stylesheet" href="bower_modules/angular-trustpass/dist/tr-trustpass.css">
<script src="bower_modules/angular-trustpass/dist/tr-trustpass.js"></script>

Then add trTrustpass as a dependency for your app:

angular.module('demoApp', ['trTrustpass']);

Usage

Basic

<input type="password" tr-trustpass>

With options

<input type="password" tr-trustpass="{special: false}" ng-minlength="9">

Using with Bootstrap classes:

<form name="demo">
  <div class="form-group" ng-class="{'has-error': demoForm.password.$invalid && demoForm.password.$dirty,
                                     'has-success': !demoForm.password.$invalid && demoForm.password.$dirty}">
    <label for="password">Password</label>
    <input id="password"
           class="form-control"
           type="password"
           name="password"
           placeholder="Password"
           tr-trustpass="{maximum: true, special: false, messageGuide: 'Make sure your password meets these requirements:'}"
           ng-minlength="9"
           ng-maxlength="90"
           ng-model="password">
  </div>
  <button type="submit" ng-disabled="demo.password.$invalid" class="btn btn-primary">Sign in</button>
</form>

Password model will have $invalid set true and $error.trustpass set true when any of the tests fail. You can then style your form or input with Angular validation classes.

Options

Pass a json object to tr-trustpass like this: tr-trustpass="{maximum: true, special: false}"

Available tests

| Option | Default | Description | |------------|---------|---------------------------------------------------------------------------------------------------------------------------| | lowercase | true | Find a-z | | uppercase | true | Find A-Z | | number | true | Find 0-9 | | special | true | Find a non-word character or the _ (underscore) character | | minimum | true | Check minimum length. Defaults to 8 but you can set it with ng-minlength or minlength attributes, or maxlength option. | | maximum | false | Check maximum length. Defaults to 50 but you can set it with ng-maxlength or maxlength attributes, or maxlength option). | | word | false | Find a word character.

"A word character" is a character from a-z, A-Z, 0-9, including the _ (underscore) character.

Other settings

| Option | Default | Description | |--------------|-------------------------------------------------|------------------------------------------------------------------------------| | toggle | false | Should checklist be visible only on focus? | | keepHeight | false | Should dropdown area keep its initially rendered height? | | minlength | 8 | Minimum length of the password, if minimum test is enabled (on by default). | | maxlength | 50 | Maximum length of the password, if maximum test is enabled (off by default). |

Labels and messages

| Option | Default | Description | |-----------------|-------------------------------------------------|---------------------------------------------------------------------------------------------------------------------| | messageDone | Great! Your password is secure. | A message shown after all tests pass. | | messageGuide | | A message on top of checklist. Leave empty to hide. | | lowercaseLabel | One lowercase character | Label for the lowercase test | | uppercaseLabel | One uppercase character | Label for the uppercase test | | numberLabel | One number | Label for the number test | | specialLabel | One special character | Label for the special test | | minimumLabel | characters minimum | Label for the minimum test. The ng-minlength value will be prepend to the label (f.i.: 8 characters minimum) | | maximumLabel | characters maximum | Label for the maximum test. The ng-maxlength value will be prepend to the label (f.i.: 8 characters maximum) | | wordLabel | Alphanumeric characters | Label for the word test |

Development

Ideas and pull requests totally welcome!

Install dependencies

npm install

Build

gulp

Run the example

gulp demo

...and open http://localhost:3000/ to your browser.

License

MIT