You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-07-16 00:14:34 +02:00
Plugins: Add support for joplin.plugins.require API to allow using sqlite3 or fs-extra from a plugin
This commit is contained in:
@ -65,4 +65,20 @@ export default class JoplinPlugins {
|
||||
return this.plugin.dataDir();
|
||||
}
|
||||
|
||||
/**
|
||||
* It is not possible to bundle native packages with a plugin, because they
|
||||
* need to work cross-platforms. Instead access to certain useful native
|
||||
* packages is provided using this function.
|
||||
*
|
||||
* Currently these packages are available:
|
||||
*
|
||||
* - [sqlite3](https://www.npmjs.com/package/sqlite3)
|
||||
* - [fs-extra](https://www.npmjs.com/package/fs-extra)
|
||||
*
|
||||
* [View the demo plugin](https://github.com/laurent22/joplin/tree/dev/packages/app-cli/tests/support/plugins/nativeModule)
|
||||
*/
|
||||
public require(_path: string): any {
|
||||
// Just a stub. Implementation has to be done within plugin process, in plugin_index.js
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user