Gathering detailed insights and metrics for postcss-message-helpers
Gathering detailed insights and metrics for postcss-message-helpers
Gathering detailed insights and metrics for postcss-message-helpers
Gathering detailed insights and metrics for postcss-message-helpers
PostCSS helpers to throw or output GNU style messages
npm install postcss-message-helpers
Typescript
Module System
Node Version
NPM Version
99.9
Supply Chain
91.9
Quality
75.1
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
510,291,198
Last Day
28,005
Last Week
583,010
Last Month
2,604,503
Last Year
32,468,691
MIT License
10 Stars
35 Commits
1 Forks
5 Watchers
3 Branches
1 Contributors
Updated on Jul 02, 2024
Minified
Minified + Gzipped
Latest Version
2.0.0
Package Id
postcss-message-helpers@2.0.0
Size
2.82 kB
NPM Version
2.1.18
Node Version
0.10.35
Published on
Jan 26, 2015
Cumulative downloads
Total Downloads
Last Day
1.5%
28,005
Compared to previous day
Last Week
-10.2%
583,010
Compared to previous week
Last Month
1.7%
2,604,503
Compared to previous month
Last Year
-3.4%
32,468,691
Compared to previous year
PostCSS helpers to throw or output GNU style messages.
This modules offers you some function to throw or just output messages with GNU style: sourcefile:lineno:column: message
1$ npm install postcss-message-helpers
1var messageHelpers = require("postcss-message-helpers")
var fnValue = messageHelpers.try(fn, source)
Execute fn
an return the value.
If an exception is thrown during the process, the exception will be catched, enhanced from source & re-throw.
var sourceMessage = messageHelpers.message(message, source)
Returns a message like sourcefile:lineno:column: message
.
source
should be a postcss source object from a node.
var source = messageHelpers.source(source)
Returns sourcefile:lineno:column
for a given source
postcss object.
1// dependencies 2var fs = require("fs") 3var postcss = require("postcss") 4var messageHelpers = require("postcss-message-helpers") 5 6// css to be processed 7var css = fs.readFileSync("input.css", "utf8") 8 9// process css 10var output = postcss() 11 .use(function(styles) { 12 styles.eachDecl(function transformDecl(decl) { 13 // will catch, adjust error stack, line, column & message (gnu style) then re-throw 14 messageHelpers.try(function IwillThrow() { 15 if (decl.value.indexOf("error(") > -1) { 16 throw new Error("error detected: " + decl.value) 17 } 18 }, decl.source) 19 20 // will output a gnu style warning 21 if (decl.value.indexOf("warning(") > -1) { 22 console.warning(messageHelpers.message("warning: " + decl.value, decl.source)) 23 } 24 }) 25 }) 26 .process(css) 27 .css
Checkout tests for more examples.
Work on a branch, install dev-dependencies, respect coding style & run tests before submitting a bug fix or a feature.
$ git clone https://github.com/MoOx/postcss-message-helpers.git
$ git checkout -b patch-1
$ npm install
$ npm test
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
3 existing vulnerabilities detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 2
Details
Reason
Found 0/23 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
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-06-30
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