mirror of
https://github.com/amark/gun.git
synced 2025-03-30 15:08:33 +00:00
👺 Add a .replace() to delete all the “\n’ (#1118)
This commit is contained in:
parent
6cb7261ac2
commit
4db88079b5
10
lib/hub.js
10
lib/hub.js
@ -28,13 +28,13 @@ function watch(what, opt) {
|
||||
.on('add', async function(path) {
|
||||
|
||||
log(`File ${path} has been added`);
|
||||
gun.get('hub').get(modifiedPath + '/' + path).put(fs.readFileSync(path, 'utf-8'))
|
||||
gun.get('hub').get(modifiedPath + '/' + path).put(fs.readFileSync(path, 'utf-8').replace(/\n/gm, ""))
|
||||
|
||||
})
|
||||
.on('change', async function(path) {
|
||||
|
||||
log(`File ${path} has been changed`);
|
||||
gun.get('hub').get(modifiedPath + '/' + path).put(fs.readFileSync(path, 'utf-8'))
|
||||
gun.get('hub').get(modifiedPath + '/' + path).put(fs.readFileSync(path, 'utf-8').replace(/\n/gm, ""))
|
||||
|
||||
})
|
||||
.on('unlink', async function (path) {
|
||||
@ -53,8 +53,4 @@ function watch(what, opt) {
|
||||
}
|
||||
}
|
||||
|
||||
gun.get('hub').on(data => {
|
||||
console.log(data);
|
||||
})
|
||||
|
||||
module.exports = { watch : watch }
|
||||
module.exports = { watch : watch }
|
||||
|
Loading…
x
Reference in New Issue
Block a user