npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, πŸ‘‹, I’m Ryan HefnerΒ  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you πŸ™

Β© 2024 – Pkg Stats / Ryan Hefner

ts-mockup-generator

v0.4.0

Published

πŸ‘·β€β™‚οΈπŸ–Όβœ… A simple mockup generator based on πŸ’ͺ TypeScript, πŸ–Ό JIMP, and πŸ‘·β€β™‚οΈ Puppeteer.

Downloads

4

Readme

ts-mockup-generator

πŸ‘·β€β™‚οΈπŸ–Όβœ… A simple mockup generator based on πŸ’ͺ TypeScript 3.7.2, πŸ–Ό JIMP, and πŸ‘·β€β™‚οΈ Puppeteer.

GitHub package.json dynamic

GitHub GitHub package.json version GitHub top language

GitHub last commit

Example

iPad Pro Example

Idea

Got a website that you want to create a mockup for? Simply pass in the URL into this CLI and it will generate screenshots with a real browser and then put them into a mockup.

Roadmap

  • [ ] Add more devices (MacBook, Desktop, Browser windows, ...).
  • [ ] Add more CLI options.
  • [ ] Add better folder structure
  • [ ] Add support for crawling multiple pages
  • [ ] Use a smaller version of puppeteer
  • [ ] Add image optimization for size
  • [x] Add support for multiple processes multiple threads via worker threads
  • [x] Run multiple instances of puppeteer in parallel

Usage

Install locally:

# Install
npm i -g ts-mockup-generator

# Run with a url
ts-mockup-generator --url https://github.com/simulieren/ts-mockup-generator

npx

npx ts-mockup-generator --url https://github.com/simulieren/ts-mockup-generator

Note: This will download about 112MB of Chromium for Puppeteer.

Options

-u --url

URL of site to use for mockup generation. The hostname will be used as the folder name.

Example: https://github.com/simulieren/ts-mockup-generator will generate a folder with the name of github inside of the mockup folder.

-s --scroll (optional)

Default: 20 Increase the distance between screenshots. The browser is scrolled by using the keyboards arrow key.

-w --wait (optional)

Default: 0 Wait in between screenshots and scrolling. This is useful when the page has got animations on scroll and you want to wait for them to finish before taking a screenshot.

-S --skip-images (optional)

Default: false Skip the screenshot generation process in Puppeteer. Use this if you already generated some images and want to skip to the mockup generation process.

-d --device (optional)

Default: ["iPad Pro landscape", "iPhone X"]

Select a device type to use for the screenshot generation process. You can get a list of available devices from the Puppeteer device list: https://github.com/GoogleChrome/puppeteer/blob/master/lib/DeviceDescriptors.js

-f --folder (optional)

Default: mockups

-D --debug (optional)

Default: false

Debug the CLI options.

Development

dev

npm run dev

Runs the CLI application.

You can pass arguments to your application by running npm run dev -- --your-argument. The extra -- is so that your arguments are passed to your CLI application, and not npm.

npm run dev -- --url https://www.google.com

clean

npm run clean

Removes any built code and any built executables.

build

npm run build

Cleans, then builds the TypeScript code.

Your built code will be in the ./dist/ directory.

test

npm run test

Cleans, then builds, and tests the built code.

bundle

npm run bundle

Cleans, then builds, then bundles into native executables for Windows, Mac, and Linux.

Your shareable executables will be in the ./exec/ directory.

Credits

This is based on the typescript-cli-starter by Khalid Zoabi

Devices are by FACEBOOK Design.