No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Making it a lot easier to loop through an array in nightmare

// Include Like this
var Nightmare = require('nightmare')
var nightmare = Nightmare({show: true})

// Or like this, if your into one-liners like me ;)
var nightmare = require('night-map')(require('nightmare'))({show: true})

var urls = ['', '', '']

	// Pass a function that returns a nightmare thing
	// I will call this function on every single element in the array
	.map(function (url) {		
		return nightmare		
	// I use .then() to collect what ever .title() spits out
	}, urls) // pass array as second parameter in typical nightmare fashion			
	.then(results => {
		console.log(results)	// => [ 'Google', 'npm', 'Node.js' ]
		return nightmare.end()