0.0.2 • Published 5 years ago

tough-cookie-sqlite3-store v0.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

tough-cookie-sqlite3-store

Usage

const path = require('path')
const request = require('request')
const CookieStore = require('tough-cookie-sqlite3-store')

const jar = request.jar(new CookieStore({
  db: new sqlite3.Database(path.resolve('cookies.sqlite3'))
}))

// const jar = request.jar(new CookieStore({
//   path: path.relative('cookies.sqlite3')
// }))

request({
  url: 'http://www.google.com',
  jar: jar
}, (error, response, body) => {
  console.log('error:', error) // Print the error if one occurred
  console.log('statusCode:', response && response.statusCode) // Print the response status code if a response was received
  console.log('body:', body) // Print the HTML for the Google homepage.
})