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

getrandomcards

v1.0.9

Published

A package which generates valid credit and debit cards.

Downloads

2

Readme

Table of contents

  1. Features
  2. Installing
  3. Example

Features

  • Generate valid random debit and credit cards
  • Provide key parameters to generate card(s) of specific brands, types, and countries.
  • Provide/specify start and end digits to be validated and attached to cards when they are generated.

Installing

npm install getrandomcards

Examples

const card = require('getrandomcards')`
card.randomcard() //Output { status: 'Success', card_number: '4892409075582441', brand: 'VISA', type: 'CREDIT', country: 'United States' }
**The randomcard() method requires no parameter and automatically generates random cards once called.**
card.startcith(2200010000) //Output { status: 'Success', card_number: '2200010000679475' }
**startwith() takes in a single parameter which should be a number not less or more than 10 digits.**
card.endwith(3126765890) //Output { status: 'Success', card_number: '3713143126765890' }
**endwith() also takes a single parameter which is a valid 10 digit number**
card.params({country: 'brazil', brand: 'american express', type: "credit"}) //Output { status: 'Success', card_number: '375177961246546', brand: 'AMERICAN EXPRESS', type: 'CREDIT', country: 'Brazil' }
**params({}) accepts an object with properties country, brand, and type of card that should be generated**

NOTE: All parameters here are required

card.randomcard(param) //Output {status: 'error', message: 'No parameter required - allow me to do my thing.'}
**Throws an error when a an argument is passed to the random card generating function**
card.endwith("3126765890") //Output { status: 'Error', message: 'Please input a valid number greater than 0' }
**Throws an error when a string input is passed**
card.startwith("3126765890") //Output { status: 'Error', message: 'Please input a valid number greater than 0' }
**Throws an error when a string input is passed**
card.endwith(312676589) //Output { status: 'Error', message: 'End number should not be less or more than 10 digits' }
**Throws an error when end number is less than 10 digits**
card.startwith(220001000) //Output { status: 'error', message: 'Start number should not be less or more than 10 digits' }
**Throws an error when start number is less than 10 digits**
card.params({country: 'wrong country', brand: 'american express', type: "credit"}) //Output { status: 'error', message:'Invalid brand and country combination / invalid brand, type, or country provided.' }
**This throws an error given an invalid country input**