mirror of
https://github.com/iptv-org/database.git
synced 2024-11-21 18:42:31 -05:00
Update file.js
This commit is contained in:
parent
af21b368bd
commit
6c18306c74
1 changed files with 10 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
const glob = require('glob')
|
const glob = require('glob')
|
||||||
const fs = require('mz/fs')
|
const fs = require('mz/fs')
|
||||||
|
const crlf = require('crlf')
|
||||||
|
|
||||||
const file = {}
|
const file = {}
|
||||||
|
|
||||||
|
@ -65,4 +66,13 @@ file.basename = function (filepath) {
|
||||||
return path.basename(filepath)
|
return path.basename(filepath)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
file.eol = function (filepath) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
crlf.get(filepath, null, function (err, endingType) {
|
||||||
|
if (err) reject(err)
|
||||||
|
resolve(endingType)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
module.exports = file
|
module.exports = file
|
||||||
|
|
Loading…
Reference in a new issue