[Node.js] Take Screenshots of Multiple Dimensions for Responsive Sites using Nightmare
When developing responsive websites, you will constantly be resizing your browser to make sure your site is properly responding to all of the resizes. You can script this behavior by using Nightmare
to leverage Electron and it will handle all the resizing for you. Nightmare can then also takes screenshots and save them so you can make sure the site matches your designs.
const Nightmare = require('nightmare');
const path = require('path'); const nightmare = new Nightmare({
show: true,
frame: false
}); nightmare
.goto('https://egghead.io')
.viewport(640, 480)
.wait(1000)
.screenshot('./screenshots/640x480.png')
.viewport(1280, 720)
.wait(1000)
.screenshot('./screenshots/1280x720.png')
.end()
.then(() => console.log("done"));
[Node.js] Take Screenshots of Multiple Dimensions for Responsive Sites using Nightmare的更多相关文章
- 2015年最佳的15个 Node.js 开发工具
Node.js 越来月流行,这个基于 Google V8 引擎建立的平台, 用于方便地搭建响应速度快.易于扩展的网络应用.在本文中,我们列出了2015年最佳的15个 Node.js 开发工具.这些工具 ...
- 推荐15个月 Node.js 开发工具
Node.js 越来月流行.这个基于 Google V8 引擎建立的平台, 用于方便地搭建响应速度快.易于扩展的网络应用.在本文中.我们列出了2015年最佳的15个 Node.js 开发工具.这些工具 ...
- Creating Node.js Command Line Utilities to Improve Your Workflow
转自:https://developer.telerik.com/featured/creating-node-js-command-line-utilities-improve-workflow/ ...
- A chatroom for all! Part 1 - Introduction to Node.js(转发)
项目组用到了 Node.js,发现下面这篇文章不错.转发一下.原文地址:<原文>. ------------------------------------------- A chatro ...
- Node.js的Formidable模块的使用
今天总结了下Node.js的Formidable模块的使用,下面做一些简要的说明. 1) 创建Formidable.IncomingForm对象 var form = new formidab ...
- [Node.js] 对称加密、公钥加密和RSA
原文地址:http://www.moye.me/2015/06/14/cryptography_rsa/ 引子 对于加解密,我一直处于一种知其然不知其所以然的状态,项目核心部分并不倚重加解密算法时,可 ...
- Node.js Web 开发框架大全《中间件篇》
这篇文章与大家分享优秀的 Node.js 中间件模块.Node 是一个服务器端 JavaScript 解释器,它将改变服务器应该如何工作的概念.它的目标是帮助程序员构建高度可伸缩的应用程序,编写能够处 ...
- 从零开始学习Node.js例子三 图片上传和显示
index.js var server = require("./server"); var router = require("./router"); var ...
- Node.js 的module 系统
相较于原生的JavaScript,不同的JavaScript文件之间很难共享变量.有鉴于此,Node.js在JavaScript的基础上进行了扩充,引入了require,exports,module三 ...
随机推荐
- 新手前端笔记之--css盒子
css盒子就是它的盒模型,所有css的布局都是以此作为基础的,很有必要来详细记录一下. 1.盒子的尺寸就是margin+padding+border+content的总和,这很好理解,但令人迷惑的可能 ...
- [Javascript AST] 1. Continue: Write a simple Babel plugin
We want to write a Babel Plugin, which move 'const versionRegex = /(/d+)\.(/d+)\.(/d+)/gi' out of fu ...
- 关于android主线程异常NetworkOnMainThread不能訪问网络
今天在学习的过程中遇到了NetworkOnMainThread的异常,关于这个异常问题在android sdk 4.0版本号上,这个问题可能比較常见,查了许些资料大多都是大概解说原因,可是没有解说到详 ...
- React评论展示案例(包含知识点:state、props、ref、React声明周期、localStorage本地存储等)
本案例在上一篇的案例(React组件之间通过Props传值的技巧(小案例,帮助体会理解props.state.受控组件和非受控组件等))的基础上加强功能和用户体验,但是当然还有很多需要改进的地方,后期 ...
- jQuery快速入门知识重点
1.jquery中attr与prop的区别 attr:是通过setAttribute 和 getAttribute来设置的使用的是DOM属性节点 prop:是通过document.getEle ...
- (转)Oracle EXP-00091解决方法
转自:http://blog.csdn.net/dracotianlong/article/details/8270136 EXP-: 正在导出有问题的统计信息. . . 正在导出表 WF_GENER ...
- IOS获取手机设备所有应用
//返回一个数组 1 NSMutableArray *applist = [[NSMutableArray alloc]init]; NSString *pathOfApplications = @& ...
- Codeforces 145A-Lucky Conversion(规律)
A. Lucky Conversion time limit per test 2 seconds memory limit per test 256 megabytes input standard ...
- Gamma correction 伽马校准及 matlab 实现
matlab 内置实现:imadjust Gamma Correction gamma correction formula : .^(gamma) or .^(1/gamma)? 用以调整图像光照强 ...
- 13、虚拟驱动vivi.c注册过程分析及怎么写V4L2驱动及启动过程
UVC设备也是一个usb设备,在uvc_driver.c中的init函数会调用usb_register注册,根据id_table发送可支持的设备后调用probe函数,其会去uvc_register_c ...