Installations
npm install postcode-validator
Developer Guide
Typescript
Yes
Module System
CommonJS
Node Version
20.18.0
NPM Version
10.8.2
Score
99.7
Supply Chain
82.5
Quality
83.3
Maintenance
100
Vulnerability
100
License
Releases
Contributors
Unable to fetch Contributors
Languages
TypeScript (78.36%)
JavaScript (21.64%)
Developer
melwynfurtado
Download Statistics
Total Downloads
8,010,286
Last Day
1,782
Last Week
81,642
Last Month
443,108
Last Year
4,301,624
GitHub Statistics
63 Stars
283 Commits
44 Forks
3 Watching
5 Branches
20 Contributors
Package Meta Information
Latest Version
3.10.2
Package Id
postcode-validator@3.10.2
Unpacked Size
40.85 kB
Size
7.10 kB
File Count
15
NPM Version
10.8.2
Node Version
20.18.0
Publised On
10 Nov 2024
Total Downloads
Cumulative downloads
Total Downloads
8,010,286
Last day
-91.2%
1,782
Compared to previous day
Last week
-24.4%
81,642
Compared to previous week
Last month
13.7%
443,108
Compared to previous month
Last year
136.7%
4,301,624
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
postcode-validator
Node.js module for parsing and validating postcodes. Country specific validation is supported for most countries including GB, US, Canada, Japan and many others.
Note: I haven't tested all combinations of postcodes for the extended country regular expressions. Please raise a PR with necessary test coverage for as many countries possible.
Install
1npm install postcode-validator
Usage
1// commonjs 2const { postcodeValidator, postcodeValidatorExistsForCountry } = require('postcode-validator'); 3// ES6 4import { postcodeValidator, postcodeValidatorExistsForCountry } from 'postcode-validator'; 5 6postcodeValidator('W85TT', 'GB'); // returns true 7postcodeValidator('1234567', 'GB'); // returns false 8 9postcodeValidatorExistsForCountry('GB'); // returns true 10postcodeValidatorExistsForCountry('Moon'); // returns false 11 12country codes: US, GB, CA, JP, INTL(International), etc
Testing
Run the unit tests with:
1npm test
Conventional Commits
Commit code using below npm script or just follow conventional commits for commit messages using git commit.
1npm run commit
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
packaging workflow detected
Details
- Info: Project packages its releases by way of GitHub Actions.: .github/workflows/release.yml:8
Reason
5 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 4
Reason
7 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22
- Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36
Reason
dependency not pinned by hash detected -- score normalized to 2
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/melwynfurtado/postcode-validator/release.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/melwynfurtado/postcode-validator/release.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/stale.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/melwynfurtado/postcode-validator/stale.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/melwynfurtado/postcode-validator/test.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/melwynfurtado/postcode-validator/test.yml/master?enable=pin
- Info: 0 out of 5 GitHub-owned GitHubAction dependencies pinned
- Info: 2 out of 2 npmCommand dependencies pinned
Reason
Found 3/18 approved changesets -- score normalized to 1
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/release.yml:1
- Warn: no topLevel permission defined: .github/workflows/stale.yml:1
- Warn: no topLevel permission defined: .github/workflows/test.yml:1
- Info: no jobLevel write permissions found
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 16 are checked with a SAST tool
Score
4.1
/10
Last Scanned on 2024-12-16
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