node-sword-interface 0.241.0 → 0.242.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/API.md
CHANGED
|
@@ -73,6 +73,7 @@ This is the main class of node-sword-interface and it provides a set of static f
|
|
|
73
73
|
* [.getSwordTranslation(originalString, localeCode)](#NodeSwordInterface+getSwordTranslation)
|
|
74
74
|
* [.getBookAbbreviation(moduleName, bookCode, localeCode)](#NodeSwordInterface+getBookAbbreviation)
|
|
75
75
|
* [.getSwordVersion()](#NodeSwordInterface+getSwordVersion) ⇒ <code>String</code>
|
|
76
|
+
* [.getSwordPath()](#NodeSwordInterface+getSwordPath) ⇒ <code>String</code>
|
|
76
77
|
|
|
77
78
|
<a name="NodeSwordInterface+repositoryConfigExisting"></a>
|
|
78
79
|
|
|
@@ -564,6 +565,13 @@ Returns the version of the SWORD library
|
|
|
564
565
|
|
|
565
566
|
**Kind**: instance method of [<code>NodeSwordInterface</code>](#NodeSwordInterface)
|
|
566
567
|
**Returns**: <code>String</code> - SWORD library version.
|
|
568
|
+
<a name="NodeSwordInterface+getSwordPath"></a>
|
|
569
|
+
|
|
570
|
+
### nodeSwordInterface.getSwordPath() ⇒ <code>String</code>
|
|
571
|
+
Returns the platform-specific path where SWORD accesses and stores its modules.
|
|
572
|
+
|
|
573
|
+
**Kind**: instance method of [<code>NodeSwordInterface</code>](#NodeSwordInterface)
|
|
574
|
+
**Returns**: <code>String</code> - Platform-specific SWORD path.
|
|
567
575
|
<a name="VerseObject"></a>
|
|
568
576
|
|
|
569
577
|
## VerseObject : <code>Object</code>
|
package/index.js
CHANGED
|
@@ -597,6 +597,14 @@ class NodeSwordInterface {
|
|
|
597
597
|
getSwordVersion() {
|
|
598
598
|
return this.nativeInterface.getSwordVersion();
|
|
599
599
|
}
|
|
600
|
+
|
|
601
|
+
/**
|
|
602
|
+
* Returns the platform-specific path where SWORD accesses and stores its modules.
|
|
603
|
+
* @returns {String} Platform-specific SWORD path.
|
|
604
|
+
*/
|
|
605
|
+
getSwordPath() {
|
|
606
|
+
return this.nativeInterface.getSwordPath();
|
|
607
|
+
}
|
|
600
608
|
}
|
|
601
609
|
|
|
602
610
|
module.exports = NodeSwordInterface;
|
package/package.json
CHANGED
|
@@ -111,7 +111,8 @@ Napi::Object NodeSwordInterface::Init(Napi::Env env, Napi::Object exports)
|
|
|
111
111
|
InstanceMethod("isModuleReadable", &NodeSwordInterface::isModuleReadable),
|
|
112
112
|
InstanceMethod("getSwordTranslation", &NodeSwordInterface::getSwordTranslation),
|
|
113
113
|
InstanceMethod("getBookAbbreviation", &NodeSwordInterface::getBookAbbreviation),
|
|
114
|
-
InstanceMethod("getSwordVersion", &NodeSwordInterface::getSwordVersion)
|
|
114
|
+
InstanceMethod("getSwordVersion", &NodeSwordInterface::getSwordVersion),
|
|
115
|
+
InstanceMethod("getSwordPath", &NodeSwordInterface::getSwordPath)
|
|
115
116
|
});
|
|
116
117
|
|
|
117
118
|
constructor = Napi::Persistent(func);
|
|
@@ -943,3 +944,15 @@ Napi::Value NodeSwordInterface::getSwordVersion(const Napi::CallbackInfo& info)
|
|
|
943
944
|
unlockApi();
|
|
944
945
|
return swVersion;
|
|
945
946
|
}
|
|
947
|
+
|
|
948
|
+
Napi::Value NodeSwordInterface::getSwordPath(const Napi::CallbackInfo& info)
|
|
949
|
+
{
|
|
950
|
+
lockApi();
|
|
951
|
+
Napi::Env env = info.Env();
|
|
952
|
+
Napi::HandleScope scope(env);
|
|
953
|
+
|
|
954
|
+
FileSystemHelper fsHelper;
|
|
955
|
+
Napi::String swordPath = Napi::String::New(env, fsHelper.getUserSwordDir());
|
|
956
|
+
unlockApi();
|
|
957
|
+
return swordPath;
|
|
958
|
+
}
|
|
@@ -96,6 +96,7 @@ private:
|
|
|
96
96
|
Napi::Value getSwordTranslation(const Napi::CallbackInfo& info);
|
|
97
97
|
Napi::Value getBookAbbreviation(const Napi::CallbackInfo& info);
|
|
98
98
|
Napi::Value getSwordVersion(const Napi::CallbackInfo& info);
|
|
99
|
+
Napi::Value getSwordPath(const Napi::CallbackInfo& info);
|
|
99
100
|
|
|
100
101
|
int validateParams(const Napi::CallbackInfo& info, std::vector<ParamType> paramSpec);
|
|
101
102
|
ModuleType getModuleTypeFromString(std::string moduleTypeString);
|