🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

postcss-message-helpers

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-message-helpers - npm Package Compare versions

Comparing version

to
1.1.0

4

CHANGELOG.md

@@ -0,3 +1,7 @@

# 1.1.0 - 2014-11-24
- `try` now returns the result of the callback
# 1.0.0 - 2014-11-24
First release

2

index.js

@@ -48,3 +48,3 @@ /**

try {
fn()
return fn()
}

@@ -51,0 +51,0 @@ catch (err) {

{
"name": "postcss-message-helpers",
"version": "1.0.0",
"version": "1.1.0",
"description": "PostCSS helpers to throw or output GNU style messages",

@@ -5,0 +5,0 @@ "keywords": [

@@ -13,4 +13,24 @@ # postcss-message-helpers [![Build Status](https://travis-ci.org/postcss/postcss-message-helpers.png)](https://travis-ci.org/postcss/postcss-message-helpers)

```js
var messageHelpers = require("postcss-message-helpers")
```
## Usage
### `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.
### Example
```js

@@ -17,0 +37,0 @@ // dependencies