All files / src textfile.js

62.5% Statements 5/8
50% Branches 1/2
33.33% Functions 1/3
100% Lines 5/5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22              1x   1x 1x           1x 1x        
import smartread from './smart-read.js'
import smartwrite from './smart-write.js'
 
 
class Textfile {
 
	constructor(path, options) {
		Iif (!path) throw new Error('invalid path')
 
		this.read = (opts) => smartread(path, opts)
		this.write = (value, opts) => smartwrite(path, value, opts)
	}
 
}
 
 
Textfile.read = smartread
Textfile.write = smartwrite
 
 
export default Textfile