Last active
April 25, 2020 07:17
-
-
Save adamculpepper/88f3d973672705c4d09ef81767932340 to your computer and use it in GitHub Desktop.
Puppeteer - Read Local File
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const puppeteer = require('puppeteer'); | |
const fs = require('fs'); | |
const util = require('util'); | |
// data | |
const rawdata = fs.readFileSync('plates.json'); | |
const textDecoder = new util.TextDecoder('utf-8'); | |
const stringData = textDecoder.decode(rawdata); | |
const objects = JSON.parse(stringData); | |
console.log(objects); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const puppeteer = require('puppeteer'); | |
const fs = require('fs'); | |
var fileContent = fs.readFileSync('file.txt', 'utf8'); | |
console.log(fileContent); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment