mj-mockup-generator

Simple & easy to use mockup generator from MockupsJar


Keywords
mockup, generator, screenshot, device, api, mockupsjar
License
MIT
Install
npm install mj-mockup-generator@1.0.30

Documentation

mj-mockup-generator

Simple & easy to use mockup generator from MockupsJar

install size Known Vulnerabilities

Install

$ npm install mj-mockup-generator

How to use the library

Usage

const mockupGenerator = require('mj-mockup-generator');
const generator = new mockupGenerator({key: process.env.API_TOKEN});

const data = {
    zoomLevel: 0.5,
    format: "jpg",
    input: ['https://dummyimage.com/750x1334/7dffb8/000000']
};

let response = await generator.render('iphone7-red', data);
console.log('response', response);
List all mockups
const mockupGenerator = require('mj-mockup-generator');
const generator = new mockupGenerator({key: process.env.API_TOKEN});

let response = await generator.list();
console.log(response);
Get info about a specific mockup
const mockupGenerator = require('mj-mockup-generator');
const generator = new mockupGenerator({key: process.env.API_TOKEN});

let response = await generator.getInfo('iphone7-red');
console.log(response);
Render simple mockup
const mockupGenerator = require('mj-mockup-generator');
const generator = new mockupGenerator({key: process.env.API_TOKEN});

const data = {
    zoomLevel: 0.5,
    format: "jpg",
    input: []
};

let task = await generator.render("iphone7-red", data);
console.log(task);
Render mockup with input image
const mockupGenerator = require('mj-mockup-generator');
const generator = new mockupGenerator({key: process.env.API_TOKEN});

const data = {
    zoomLevel: 0.5,
    format: "jpg",
    input: ['https://dummyimage.com/750x1334/7dffb8/000000']
};

let task = await generator.render("iphone7-red", data);
console.log(task);
Render mockup with input website url
const mockupGenerator = require('mj-mockup-generator');
const generator = new mockupGenerator({key: process.env.API_TOKEN});

const data = {
    zoomLevel: 0.5,
    format: "jpg",
    input: ['https://m.imdb.com/title/tt2395427/']
};

let task = await generator.render("iphone7-red", data);
console.log(task);

Resources

MockupsJar - MockupsJar website

MockupsJar API Intro - quick introduction

MockupsJar API Doc - full API documentation

MockupsJar NPM Package