Comparing version 1.0.0 to 1.0.1
@@ -90,3 +90,3 @@ // Generated by CoffeeScript 1.10.0 | ||
stats = fs.statSync(this.filename); | ||
this.pos = pos ? pos : stats.size; | ||
this.pos = pos != null ? pos : stats.size; | ||
if (fs.watch) { | ||
@@ -93,0 +93,0 @@ return this.watcher = fs.watch(this.filename, this.fsWatchOptions, (function(_this) { |
{ | ||
"author": "Luca Grulla", | ||
"author":{"name": "Luca Grulla", | ||
"url" : "http://www.lucagrulla.com"}, | ||
"contributors": [ | ||
@@ -8,3 +9,3 @@ "Luca Grulla", | ||
"description": "tail a file in node", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"homepage": "http://www.lucagrulla.com/node-tail", | ||
@@ -11,0 +12,0 @@ "repository": { |
#tail | ||
[](https://nodei.co/npm/tail/) | ||
[](https://nodei.co/npm/tail.png?downloads=true&downloadRank=true) | ||
@@ -25,23 +25,18 @@ To install: | ||
```` | ||
The only mandatory parameter is the path to the file to tail. You can pass optional parameters passed via a hash: | ||
Tail constructor accepts optional parameters passed via a hash: | ||
```javascript | ||
var fileToTail = "/path/to/fileToTail.txt"; | ||
new Tail(fileToTail) | ||
``` | ||
or | ||
var options= {lineSeparator= /[\r]{0,1}\n/, fromBeginning = false, watchOptions = {}, follow = true} //default, equivalent to not passing the hash | ||
```javascript | ||
var options= {lineSeparator= /[\r]{0,1}\n/, fromBeginning = false, watchOptions = {}, follow = true} //default value, equivalent to not passing | ||
new Tail(fileToTail, options) | ||
``` | ||
//lineSeparator default is now a regex that handle linux/mac (9+)/windows | ||
//fromBeginning to control if start tailing | ||
var lineSeparator= /[\r]{0,1}\n/; // default is now a regex that handle linux/mac (9+)/windows | ||
var fromBeginning = false; | ||
var watchOptions = {}; // as per node fs.watch documentations | ||
* `fileToTail` is the name (inclusive of the path) of the file to tail | ||
* `options` is a hash. The following keys are accepted: | ||
* `lineSeparator`: the line separator token (default /[\r]{0,1}\n/ to handle linux/mac (9+)/windows) | ||
* `lineSeparator`: the line separator token (default `/[\r]{0,1}\n/` to handle linux/mac (9+)/windows) | ||
* `watchOptions`: the full set of options that can be passed to `fs.watch` as per node documentation (default: {}) | ||
@@ -48,0 +43,0 @@ * `fromBeginning`: forces the tail of the file from the very beginning of it instead of from the first new line that will be appended (default: `false`) |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
9692
193
0
77