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

is-password-secure

v1.0.1

Published

Check password security using Ollama API

Readme

is-password-secure

A simple NPM package for verifying password security using the Ollama API. This package uses artificial intelligence models to analyze passwords and assess their security.

Installation

npm install is-password-secure
yarn add is-password-secure
bun add is-password-secure

Requirements

  • Node.js (>= 14.0.0)
  • Working local or remote Ollama API server

Usage

Basic usage:

import { isPasswordSecure } from 'is-password-secure';
// const { isPasswordSecure } = require('is-password-secure');

async function checkPassword() {
  try {
    const result = await isPasswordSecure('YourPassword123!');
    console.log(result);
    
    if (result.isSecure) {
      console.log('Your password is secure!');
    } else {
      console.log('Your password is not secure. Suggestion: ' + result.feedback);
    }
  } catch (error) {
    console.error('An error occurred:', error);
  }
}

checkPassword();

Configuration

You can customize the function's behavior by passing an options object:

const result = await isPasswordSecure('YourPassword123!', {
  ollamaUrl: 'http://localhost:11434', // Default URL to the Ollama API
  model: 'llama2',                     // Ollama model to use
  timeout: 10000                       // Request timeout in ms
});

Available Models

You can use any model available in your Ollama installation. Some common examples:

  • llama2 (default)
  • mistral
  • llama3.2
  • gemma
  • codellama
  • phi

Check your Ollama installation for available models.

Results Format

The function returns an object with the following properties:

{
  score: 75,             // Score from 0 to 100
  rating: 'strong',      // Verbal description: very weak, weak, moderate, strong, very strong
  feedback: 'Your password is good, but you might consider adding more special characters.',
  isSecure: true         // Boolean indicating if the password is considered secure (score > 60)
}

How It Works

The package connects to the Ollama API and sends the provided password for evaluation by an artificial intelligence model. The model acts as a security manager, analyzing the password for:

  1. Length
  2. Complexity (character diversity)
  3. Avoidance of common patterns
  4. Uniqueness

TypeScript Support

This package is written in TypeScript and provides full type definitions:

import { isPasswordSecure }, { PasswordSecurityResult, PasswordSecurityOptions } from 'is-password-secure';

const options: PasswordSecurityOptions = {
  model: 'llama3',
  timeout: 15000
};

const result: PasswordSecurityResult = await isPasswordSecure('password123', options);

Note

This package is more fun than a serious cybersecurity tool. Although it works correctly, for real production applications, I recommend using proven security libraries and best practices.

License

MIT