What do you want to save?
Add Code snippet
New code examples
-
SQL 2021-11-18 00:22:09
async await mysql nodejs
const mysql = require('mysql'); // or use import if you use TS const util = require('util'); const conn = mysql.createConnection({yourHOST/USER/PW/DB}); // node native promisify const query = util.promisify(conn.query).bind(conn); (async () => { tr... Add solution -
Javascript 2021-11-13 19:57:21
js async generator
async function* generateSequence(start, end) { for (let i = start; i <= end; i++) { await new Promise(resolve => setTimeout(resolve, 1000)); yield i; } } (async () => { let generator = generateSequence(1, 5); for await (let value... Add solution -
Javascript 2021-11-10 21:51:11
Generate PDFs From HTML & CSS with Node.js using Puppeteer
/* This code comes from Vincent Lab And it has a video version linked here: https://www.youtube.com/watch?v=wQEeFaqVQgw */ // Import dependencies const puppeteer = require("puppeteer"); const fs = require("fs"); (async () =&g... Add solution -
Shell/Bash 2021-11-06 04:32:14
puppet install on centos 7
curl -sL https://rpm.nodesource.com/setup_10.x | sudo -E bash - yum install nodejs 1 2 3 4 5 6 7 curl -sL https://rpm.nodesource.com/setup_10.x | sudo -E bash - yum install nodejs Step 2 :- Install Puppeteer In CentOS 7 npm i pupeteer 1 npm... Add solution -
ActionScript 2021-11-03 17:55:07
Error: Forbidden testing strapi
const request = require("supertest") const { grantPrivilege } = require("./../helpers/strapi"); beforeAll(async () => { await grantPrivilege(2, "permissions.application.controllers.hello.index"); // Gives Public access... Add solution -
Javascript 2021-10-25 05:24:11
Manually Parsing PDF in Node.js
/* This code comes from Vincent Lab And it has a video version linked here: https://www.youtube.com/watch?v=b2dLDqmYT4I */ // Import dependencies const fs = require("fs"); const PDFParser = require("pdf2json"); // Get all the... Add solution -
Javascript 2021-10-20 15:25:04
save file as get dimensions puppeteer js
const puppeteer = require('puppeteer'); (async () => { const browser = await puppeteer.launch(); const page = await browser.newPage(); await page.goto('https://example.com'); // Get the "viewport" of the page, as reported by the pag... Add solution