Gathering detailed insights and metrics for @janario/cpf
Gathering detailed insights and metrics for @janario/cpf
Gathering detailed insights and metrics for @janario/cpf
Gathering detailed insights and metrics for @janario/cpf
npm install @janario/cpf
Typescript
Module System
Node Version
NPM Version
67.6
Supply Chain
90.5
Quality
75.1
Maintenance
100
Vulnerability
100
License
TypeScript (57.8%)
JavaScript (42.2%)
Total Downloads
1,808
Last Day
4
Last Week
9
Last Month
24
Last Year
333
166 Stars
21 Commits
6 Forks
2 Watching
1 Branches
3 Contributors
Latest Version
0.1.0-beta.2
Package Id
@janario/cpf@0.1.0-beta.2
Unpacked Size
18.01 kB
Size
4.59 kB
File Count
10
NPM Version
6.1.0
Node Version
8.11.1
Cumulative downloads
Total Downloads
Last day
0%
4
Compared to previous day
Last week
80%
9
Compared to previous week
Last month
-44.2%
24
Compared to previous month
Last year
-45.4%
333
Compared to previous year
This package does some CPF magic. It allows you to create, validate and format CPF documents.
HINT: Check out the CNPJ counter part available at https://github.com/fnando/cnpj.
This lib is available as a NPM package. To install it, use the following command:
npm install @fnando/cpf --save
If you're using Yarn (and you should):
yarn add @fnando/cpf
1import * as cpf from "@fnando/cpf"; // import the whole library 2import { isValid as isValidCpf } from "@fnando/cpf"; // import just one function 3 4// import via <script>; the lib will available as window.cpf 5// <script src="cpf.js"></script> 6 7cpf.isValid("532.820.857-96"); 8//=> true 9 10cpf.isValid("53282085796"); 11//=> true 12 13cpf.strip("532.820.857-96"); 14//=> 53282085796 15 16cpf.format("53282085796"); 17//=> 532.820.857-96 18 19cpf.generate(true); // generate formatted number 20//=> 838.684.734-40 21 22cpf.generate(); // generate unformatted number 23//=> 72777632898
By default, validations will strip any characters you provide. This means that the following is valid, because only numbers will be considered:
1cpf.isValid("101#688!!!!!!542......36"); 2//=> true 3 4cpf.strip("101#688!!!!!!542......36"); 5//=> 10168854236
If you want to strict validate strings, use the following signature:
1cpf.isValid(number, strict);
The same example would now return false
:
1cpf.isValid("101#688!!!!!!542......36", true); 2//=> false
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 2/19 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-12-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More