UNPKG
data_scraper
Version:
latest (1.0.0)
1.0.0
data scraper for shirts4mike.com
github.com/brunouno/project06
brunouno/project06
data_scraper
/
scraper.js
14 lines
(11 loc)
•
241 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
const
fs =
require
(
'fs'
);
const
shirts =
require
(
'./shirts'
);
// check if ./data exists
if
(fs.
existsSync
(
'./data'
)) { shirts.
get
(); }
else
{
console
.
log
(
'Creating ./data directory'
); fs.
mkdir
(
'./data'
,
() =>
{ shirts.
get
(); }); }