Arrays of Extensions Not Accepted as per Documentation
Closed this issue · 4 comments
F1LT3R commented
What version are you using? (Don't say latest. Be specific.)
0.6.0
Expected result
The README says
"
exts
is an array of extensions you want to observe. "
https://github.com/napcs/node-livereload/blame/master/README.md#L156
Example:
const ary = [
'.md',
'.text'
];
const liveReloadServer = liveReload.createServer({
port: 35729,
exts: ary
}).watch(list);
Actual result
Nothing happens when you pass an array, you have to pass a string.
Example:
const ary = [
'.md',
'.text'
];
const liveReloadServer = liveReload.createServer({
port: 35729,
exts: ary.join(' ')
}).watch(list);
Steps to reproduce issue
Use the code above.
Why is this important?
Docs are confusing. The JavaScript part of the API could be more JavaScript~y.
napcs commented
Ugh. Thanks - that whole bit is gross and needs to be cleaned up.
napcs commented
@F1LT3R I tested this with the following:
var liveReload = require(livereload');
const ary = [
'md',
'text'
];
const liveReloadServer = liveReload.createServer({
port: 35729,
debug: true,
exts: ary
}).watch(__dirname);
Note that my array of extensions to watch do not include the leading period.
The code works as expected:
Refresh: /Users/brianhogan/dev/oss/node-livereload/README.md
Closing as "can't reproduce"