UNPKG
fatstraw
Version:
latest (1.4.0)
1.4.0
1.3.0
1.2.0
1.1.0
1.0.0
CLI for ingesting data into the ArcGIS Big Data Store
github.com/dmfenton/fatstraw
dmfenton/fatstraw
fatstraw
/
lib
/
ingest
/
get-file.js
11 lines
(9 loc)
•
290 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
const
fs =
require
(
'fs'
)
const
request =
require
(
'request'
).
defaults
({
gzip
:
true
})
const
_ =
require
(
'highland'
)
module
.
exports
=
function
getFile
(
file
) {
let
stream
if
(file.
match
(
/^https?:\/\//
)) stream =
request
(file)
else
stream = fs.
createReadStream
(file)
return
_
(stream) }