deprecation
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "deprecation", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Log a deprecation message with stack", | ||
@@ -9,5 +9,16 @@ "main": "index.js", | ||
}, | ||
"keywords": [], | ||
"keywords": [ | ||
"deprecate", | ||
"deprecated", | ||
"deprecation" | ||
], | ||
"author": "Gregor Martynus (https://twitter.com/gr2m", | ||
"license": "ISC" | ||
"license": "ISC", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/gr2m/deprecation.git" | ||
}, | ||
"devDependencies": { | ||
"semantic-release": "^15.13.3" | ||
} | ||
} |
@@ -21,3 +21,3 @@ # deprecation | ||
function baz () { | ||
console.log(new Deprecation('[my-lib] foo() is deprecated, use bar()')) | ||
console.warn(new Deprecation('[my-lib] foo() is deprecated, use bar()')) | ||
} | ||
@@ -32,4 +32,20 @@ | ||
To log a deprecation message only once, you can use the [once](https://www.npmjs.com/package/once) module. | ||
```js | ||
const Deprecation = require('deprecation') | ||
const once = require('once') | ||
const deprecateFoo = once(console.warn) | ||
function foo () { | ||
deprecateFoo(new Deprecation('[my-lib] foo() is deprecated, use bar()')) | ||
} | ||
foo() | ||
foo() // logs nothing | ||
``` | ||
## License | ||
[ISC](LICENSE) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
3649
49
0
1
6
30