braidfs 0.0.16 → 0.0.18

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/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env node
1
2
 
2
3
  let http = require('http');
3
4
  let { diff_main } = require('./diff.js')
@@ -13,8 +14,8 @@ braid_text.db_folder = require('path').join(braidfs_config_dir, 'braid-text-db')
13
14
 
14
15
  let config = {
15
16
  port: 10000,
16
- pin_urls: [],
17
- pindex_urls: [],
17
+ sync_urls: [],
18
+ sync_index_urls: [],
18
19
  proxy_base: require('path').join(require('os').homedir(), 'http'),
19
20
  proxy_base_last_versions: require('path').join(braidfs_config_dir, 'proxy_base_last_versions')
20
21
  }
@@ -31,12 +32,12 @@ while (argv.length) {
31
32
  let a = argv.shift()
32
33
  if (a.match(/^\d+$/)) {
33
34
  config.port = parseInt(a)
34
- } else if (a === '-pin') {
35
+ } else if (a === 'sync') {
35
36
  let b = argv.shift()
36
37
  if (b === 'index') {
37
- config.pindex_urls.push(argv.shift())
38
+ config.sync_index_urls.push(argv.shift())
38
39
  } else {
39
- config.pin_urls.push(b)
40
+ config.sync_urls.push(b)
40
41
  }
41
42
  }
42
43
  }
@@ -45,9 +46,9 @@ while (argv.length) {
45
46
  require('fs').mkdirSync(config.proxy_base, { recursive: true })
46
47
  require('fs').mkdirSync(config.proxy_base_last_versions, { recursive: true })
47
48
 
48
- console.log({ pin_urls: config.pin_urls, pindex_urls: config.pindex_urls })
49
- for (let url of config.pin_urls) proxy_url(url)
50
- config.pindex_urls.forEach(async url => {
49
+ console.log({ sync_urls: config.sync_urls, sync_index_urls: config.sync_index_urls })
50
+ for (let url of config.sync_urls) proxy_url(url)
51
+ config.sync_index_urls.forEach(async url => {
51
52
  let prefix = new URL(url).origin
52
53
  while (true) {
53
54
  let urls = await (await fetch(url)).json()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "braidfs",
3
- "version": "0.0.16",
3
+ "version": "0.0.18",
4
4
  "description": "braid technology synchronizing files and webpages",
5
5
  "author": "Braid Working Group",
6
6
  "repository": "braid-org/braidfs",
@@ -9,5 +9,8 @@
9
9
  "braid-http": "^0.3.20",
10
10
  "braid-text": "^0.0.26",
11
11
  "chokidar": "^3.6.0"
12
+ },
13
+ "bin": {
14
+ "braidfs": "./index.js"
12
15
  }
13
16
  }
@@ -1 +0,0 @@
1
- abcd