Skip to content

Commit 4683cd0

Browse files
committed
feat(api): expose getVersion statically
1 parent d8b58d3 commit 4683cd0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

packages/core/src/index.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,15 @@ const getDefaultConfig = function() {
4242
return defaultConfig;
4343
};
4444

45+
/**
46+
* Returns current version
47+
*
48+
* @returns {string} current patternlab-node version as defined in `package.json`, as string
49+
*/
50+
const getVersion = function() {
51+
return packageInfo.version;
52+
};
53+
4554
const patternlab_module = function(config) {
4655
const PatternLabClass = require('./lib/patternlab');
4756
const patternlab = new PatternLabClass(config);
@@ -222,5 +231,6 @@ const patternlab_module = function(config) {
222231
};
223232

224233
patternlab_module.getDefaultConfig = getDefaultConfig;
234+
patternlab_module.getVersion = getVersion;
225235

226236
module.exports = patternlab_module;

0 commit comments

Comments
 (0)