mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 06:20:12 +01:00
Add getVersion function to exports for easy access by tooling (ex: CLI).
This commit is contained in:
parent
bd50a15a96
commit
a971361cf2
4 changed files with 28 additions and 1 deletions
|
|
@ -985,10 +985,20 @@ function readConfigSync(file, parsers) {
|
|||
return config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the (semantic) version of the library.
|
||||
*
|
||||
* @returns {string} SemVer string.
|
||||
*/
|
||||
function getVersion() {
|
||||
return require("../package.json").version;
|
||||
}
|
||||
|
||||
// Export a/synchronous/Promise APIs
|
||||
markdownlint.sync = markdownlintSync;
|
||||
markdownlint.readConfig = readConfig;
|
||||
markdownlint.readConfigSync = readConfigSync;
|
||||
markdownlint.getVersion = getVersion;
|
||||
markdownlint.promises = {
|
||||
"markdownlint": markdownlintPromise,
|
||||
"readConfig": readConfigPromise
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue