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

permugenjs

v1.1.0

Published

permugenjs is an NPM package that generates all possible permutations (not just combinations) of a given string.

Readme

permugenjs

permugenjs is an NPM package that generates all possible permutations (not just combinations) of a given string.

📌 What Does “All Possible Combinations” Mean?

Given an input string, this tool returns all the possible unique permutations of its characters.

Example: If the input string is: ABCD Then the total number of permutations is 4! = 24.

Sample output:

 [
        "1342",
        "1432",
        "2341",
        "2431",
        "1243",
        "1423",
        "3241",
        "3421",
        "2143",
        "2413",
        "3142",
        "3412",
        "4231",
        "4321",
        "1234",
        "1324",
        "4132",
        "4312",
        "2134",
        "2314",
        "4123",
        "4213",
        "3124",
        "3214"
    ]

✅ Validation Rules The input string must satisfy the following conditions: 1.Input must be a valid string 2.Only letters and numbers are allowed (a-z, A-Z, 0-9) 3.Special characters like &^%@#$!~,/|{}](*)+-` are not allowed 4.The input string must contain at least 2 and at most 10 characters

📦 Installation

npm install permugenjs

🧑‍💻 TypeScript Support

This package is fully compatible with TypeScript.

📘 Usage

React ->


import { getCombinationsGenerator } from "permugenjs";

export default function MainComponent() {
  return (
    <div>
      <label>Enter a number </label>
      <input name="val" id="val" />
      <button
        onClick={(e) => {
          let inputParam = document.getElementById("val").value;
          const promiseData = getCombinationsGenerator(inputParam);
          promiseData
            .then(function (res) {
              console.log("res====>", res);
            })
            .catch((err) => {
              console.log(err);
            });
        }}
      >
        Enter
      </button>
    </div>
  );
}

Node JS with .js file (with CommonJS)


const express = require('express');
const pkg = require('permugenjs');

const app = express ();
const {getCombinationsGenerator} = pkg;

app.use(express.json());
const PORT = process.env.PORT || 6000;
app.listen(PORT, () => {
    console.log("Server Listening on PORT:", PORT);
});


app.get("/status", async (request, response) => {
    const req = request.query.input;

    const combinations=getCombinationsGenerator(String(req));
    combinations.then((res)=>{
        const status = {
            combinations: res,
            Status: "Running"
         };    
         response.send(status);
    })
 });  

Node JS with .mjs file (with ESM)


import  express from 'express';
import {getCombinationsGenerator} from 'permugenjs';
const app = express ();

app.use(express.json());
const PORT = process.env.PORT || 6000;
app.listen(PORT, () => {
    console.log("Server Listening on PORT:", PORT);
});


app.get("/status", async (request, response) => {
    const req = request.query.input;
    const combinations=getCombinationsGenerator(String(req));
    combinations.then((res)=>{
        const status = {
            combinations: res,
            Status: "Running"
         };    
         response.send(status);
    })    
 });  

Output -->


{
    "combinations": [
        "airb",
        "arib",
        "bira",
        "bria",
        "abri",
        "arbi",
        "ibra",
        "irba",
        "bari",
        "brai",
        "iarb",
        "irab",
        "rbia",
        "riba",
        "abir",
        "aibr",
        "raib",
        "riab",
        "bair",
        "biar",
        "rabi",
        "rbai",
        "iabr",
        "ibar"
    ],
    "Status": "Running"
}

✅ The function has built-in type definitions: generateCombinations(input: string): string[]

🚀 Performance Notes The function uses a recursive algorithm to generate all permutations. The time complexity is O(n!), where n is the number of characters in the string. For performance reasons, it's recommended to limit input length to 10 characters or fewer. Generating permutations for strings longer than 10 characters may cause performance issues or memory exhaustion.

Input Length Estimated Permutations

| Time | Memory | Usage | |------:|------------:|:------------ | | 4 | 24 | Fast(🟢) | | 6 | 720 | Moderate(🟡) | | 8 | 40,320 | High(🔴) | | 10 | 3,628,800 | Very High(🚨)|

Creator's Note


Dear user,
Thank you for visiting and using the permugenjs npm package.
Currently, the repository is private due to certain reasons.

If you encounter any issues, please feel free to email me at [email protected] with the subject line:
Current Date|Permugenjs Issue – Your Name

I’ll do my best to address and resolve the issue as soon as possible.

Best regards,
Abirlal Mukherjee

Contribution is Close