Installations
npm install @ericcarraway/css-classname-hash
Developer Guide
Typescript
No
Module System
CommonJS
Min. Node Version
>=10
Node Version
16.13.0
NPM Version
8.1.4
Score
66.3
Supply Chain
73.2
Quality
75.5
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (97.59%)
TypeScript (1.74%)
Shell (0.67%)
Developer
ericcarraway
Download Statistics
Total Downloads
20,426
Last Day
14
Last Week
55
Last Month
284
Last Year
4,949
GitHub Statistics
1 Stars
66 Commits
3 Watching
1 Branches
1 Contributors
Bundle Size
612.00 B
Minified
408.00 B
Minified + Gzipped
Package Meta Information
Latest Version
0.0.4
Package Id
@ericcarraway/css-classname-hash@0.0.4
Unpacked Size
5.08 kB
Size
2.43 kB
File Count
5
NPM Version
8.1.4
Node Version
16.13.0
Total Downloads
Cumulative downloads
Total Downloads
20,426
Last day
40%
14
Compared to previous day
Last week
-26.7%
55
Compared to previous week
Last month
8%
284
Compared to previous month
Last year
-63.1%
4,949
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
@ericcarraway/css-classname-hash
css-classname-hash
is an opinionated string hashing function for minifying CSS class names in Node.js, intended for use in front-end build systems.
INSTALLATION
npm i --save-dev @ericcarraway/css-classname-hash
USAGE
1// note the `.default` 2const hashClassName = require('@ericcarraway/css-classname-hash').default; 3 4// an example BEM class name 5hashClassName('block-name__elem-name_mod-name_mod-val') // 'YMpSk' 6 7// other examples 8hashClassName('container') // 'Xwtuv' 9hashClassName('header') // 'CZ5lT' 10hashClassName('navigation') // 'ZFgu9'
DETAILS
-
Creates a base64-encoded md5 hash using Node's built-in
crypto
module -
Removes characters that are invalid for CSS class names
-
Ensures that the hashed CSS class name
- Starts with a letter
- Is five characters long
Bootstrapped with TSDX
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
Found 0/8 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/main.yml:1
- Warn: no topLevel permission defined: .github/workflows/size.yml:1
- Info: no jobLevel write permissions found
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/ericcarraway/css-classname-hash/main.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/ericcarraway/css-classname-hash/main.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/ericcarraway/css-classname-hash/main.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/size.yml:9: update your workflow using https://app.stepsecurity.io/secureworkflow/ericcarraway/css-classname-hash/size.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/size.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/ericcarraway/css-classname-hash/size.yml/main?enable=pin
- Info: 0 out of 3 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 2 third-party GitHubAction dependencies pinned
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
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'main'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 25 are checked with a SAST tool
Reason
26 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-x9w5-v3q2-3rhw
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq
- Warn: Project is vulnerable to: GHSA-434g-2637-qmqr
- Warn: Project is vulnerable to: GHSA-49q7-c7j4-3p7m
- Warn: Project is vulnerable to: GHSA-977x-g7h5-7qgw
- Warn: Project is vulnerable to: GHSA-f7q4-pwc6-w24p
- Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747
- Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h
- Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq
- Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488
- Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55
- Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc
- Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3
- Warn: Project is vulnerable to: GHSA-hc6q-2mpp-qw7j
- Warn: Project is vulnerable to: GHSA-4vvj-4cpr-p986
- Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7
- Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q
Score
2.5
/10
Last Scanned on 2025-01-27
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