bajo 2.22.0 → 2.23.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/class/bajo.js +12 -3
- package/package.json +1 -1
- package/wiki/CHANGES.md +5 -0
- package/wiki/ECOSYSTEM.md +6 -6
package/class/bajo.js
CHANGED
|
@@ -1021,6 +1021,17 @@ class Bajo extends Plugin {
|
|
|
1021
1021
|
return results
|
|
1022
1022
|
}
|
|
1023
1023
|
|
|
1024
|
+
/**
|
|
1025
|
+
* Get download directory. If doesn't exist, it will be created automatically.
|
|
1026
|
+
* @method
|
|
1027
|
+
* @returns {string} Absolute path to the download directory
|
|
1028
|
+
*/
|
|
1029
|
+
getDownloadDir = () => {
|
|
1030
|
+
const dir = `${this.app.getPluginDataDir(this.ns)}/download`
|
|
1031
|
+
fs.ensureDirSync(dir)
|
|
1032
|
+
return dir
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1024
1035
|
/**
|
|
1025
1036
|
* Save item as file in Bajo's download directory. That is a directory inside your
|
|
1026
1037
|
* Bajo plugin's data directory.
|
|
@@ -1037,9 +1048,7 @@ class Bajo extends Plugin {
|
|
|
1037
1048
|
*/
|
|
1038
1049
|
saveAsDownload = async (file, item, printSaved = true) => {
|
|
1039
1050
|
const { print } = this.app.bajo
|
|
1040
|
-
const fname = increment(`${this.
|
|
1041
|
-
const dir = path.dirname(fname)
|
|
1042
|
-
if (!fs.existsSync(dir)) fs.ensureDirSync(dir)
|
|
1051
|
+
const fname = increment(`${this.getDownloadDir()}/${trim(file, '/')}`, { fs: true })
|
|
1043
1052
|
await fs.writeFile(fname, item, 'utf8')
|
|
1044
1053
|
if (printSaved) print.succeed('savedAs%s', path.resolve(fname), { skipSilence: true })
|
|
1045
1054
|
return fname
|
package/package.json
CHANGED
package/wiki/CHANGES.md
CHANGED
package/wiki/ECOSYSTEM.md
CHANGED
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
| ------- | ---- | -- | ----- | ----------- |
|
|
24
24
|
| [dobo](https://github.com/ardhi/dobo) | [Docs](https://ardhi.github.io/dobo) | dobo | db | Dobo DBMS |
|
|
25
25
|
| [dobo-extra](https://github.com/ardhi/dobo-extra) | [Docs](https://ardhi.github.io/dobo-extra) | doboExtra | dbx | Dobo Extra Tools/Utility |
|
|
26
|
-
| [dobo-couchdb](https://github.com/ardhi/dobo-couchdb) | [Docs](https://ardhi.github.io/dobo-couchdb) | doboCouchdb | dbcouch | CouchDB
|
|
27
|
-
| [dobo-elasticsearch](https://github.com/ardhi/dobo-elasticsearch) | [Docs](https://ardhi.github.io/dobo-elasticsearch) | doboElasticsearch | dbes | Elasticsearch
|
|
28
|
-
| [dobo-knex](https://github.com/ardhi/dobo-knex) | [Docs](https://ardhi.github.io/dobo-knex) | doboKnex | dbknex | Knex/SQL
|
|
29
|
-
| [dobo-mongodb](https://github.com/ardhi/dobo-mongodb) | [Docs](https://ardhi.github.io/dobo-mongodb) | doboMongodb | dbmongo | MongoDB
|
|
30
|
-
| [dobo-redis](https://github.com/ardhi/dobo-redis) | [Docs](https://ardhi.github.io/dobo-redis) | doboRedis | dbredis | Redis
|
|
31
|
-
| [dobo-restproxy](https://github.com/ardhi/dobo-restproxy) | [Docs](https://ardhi.github.io/dobo-restproxy) | doboRestproxy | dbrpx | Restproxy
|
|
26
|
+
| [dobo-couchdb](https://github.com/ardhi/dobo-couchdb) | [Docs](https://ardhi.github.io/dobo-couchdb) | doboCouchdb | dbcouch | CouchDB Adapter |
|
|
27
|
+
| [dobo-elasticsearch](https://github.com/ardhi/dobo-elasticsearch) | [Docs](https://ardhi.github.io/dobo-elasticsearch) | doboElasticsearch | dbes | Elasticsearch Adapter |
|
|
28
|
+
| [dobo-knex](https://github.com/ardhi/dobo-knex) | [Docs](https://ardhi.github.io/dobo-knex) | doboKnex | dbknex | Knex/SQL Adapter |
|
|
29
|
+
| [dobo-mongodb](https://github.com/ardhi/dobo-mongodb) | [Docs](https://ardhi.github.io/dobo-mongodb) | doboMongodb | dbmongo | MongoDB Adapter |
|
|
30
|
+
| [dobo-redis](https://github.com/ardhi/dobo-redis) | [Docs](https://ardhi.github.io/dobo-redis) | doboRedis | dbredis | Redis Adapter |
|
|
31
|
+
| [dobo-restproxy](https://github.com/ardhi/dobo-restproxy) | [Docs](https://ardhi.github.io/dobo-restproxy) | doboRestproxy | dbrpx | Restproxy Adapter |
|
|
32
32
|
| [dobo-restproxy-jsonserver](https://github.com/ardhi/dobo-restproxy-jsonserver) | [Docs](https://ardhi.github.io/dobo-restproxy-jsonserver) | doboResporoxyJsonserver | dbrpxjs |JsonServer Support for doboRestproxy |
|
|
33
33
|
| [dobo-restproxy-ndut](https://github.com/ardhi/dobo-restproxy-ndut) | [Docs](https://ardhi.github.io/dobo-restproxy-ndut) | doboRestproxyNdut | dbrpxndut | NDUT Support for doboRestproxy |
|
|
34
34
|
|