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

@zappar/zapworks-cli

v2.0.8

Published

A command-line utility to help you build and publish augmented reality experiences with ZapWorks

Downloads

286

Readme

ZapWorks CLI

This is a command line utility that helps you perform a range of augmented reality tasks, including:

  • training images for use as image targets with Zappar's Universal AR SDKs
  • serve the contents of a directory on your computer to let you preview on your computer or a device on your local network
  • initialize new projects with templates for a variety of tools and technologies
  • upload and publish web-based Universal AR projects through ZapWorks

Getting Started

To install and use the ZapWorks CLI, first make sure you have Node.js installed, then just run the following command in a terminal on your computer:

npm i -g @zappar/zapworks-cli

Please note that the ZapWorks CLI is designed to work with Node.js version 16 or lower. If you are using Node.js above version 16, it is recommended to use the beta branch of the ZapWorks CLI.

To install the beta version, you can use the following command: sh npm i -g @zappar/zapworks-cli@beta

Once installed you can use the CLI on your command line with thusly:

zapworks ...

Usage

Training Image Files

Zappar's set of Universal SDKs let you track and attach content to images in 3D space. To do so, the SDKs need a file that contains an optimized description of the image, called a target file. To generate a target file from an image, use the CLI's train command:

zapworks train myImage.png

The CLI can train PNG or JPEG images, and they should be at least 300px in each dimension to be effective. The command will output a new file, in this case myImage.zpt, in the current directory. You can sent the output to a different location if you like:

zapworks train myImage.png -o myFolder/target.zpt

Cylindrical targets

You may train images for cylindrical targets. To do so, provide the radius of the cylinder:

zapworks train myImage.png --radius 55mm
zapworks train myImage.png --radius 500px --dpi 110

The following units are accepted: target, mm, cm, m, in, px.

To wrap the image all the way around, simply pass in --curved when training:

zapworks train myImage.png --curved

You might like to check out the following ZapWorks Docs article: What Makes a Good Tracking Image?

Serving Directories

Due to browser restrictions, web pages that use the camera must be served over HTTPS. To help with local development of your web-based AR experiences, the CLI includes a tool that will serve a directory of your choice for access from your computer, or from a device on your local network.

To serve your current folder from a terminal, run the following command:

zapworks serve

That will start a server and give you URL that you can use to access the current folder over HTTPS. If you'd like to serve a different folder, that's easy too:

zapworks serve myDistFolder/

If you'd like to access the site from other devices on your local network, e.g. your mobile phone, pass the --lan parameter:

zapworks serve --lan

With this parameter, the CLI will output a link that should work for devices on your local network, and a QR code containing the same URL that you may like to scan on a mobile device to get up and running quickly.

Note - if you're using webpack to bundle your project (which we do recommend), you may not need this tool :-) The webpack-dev-server package can serve your content on your local network over HTTPS if you set the following options in your webpack configuration:

module.exports = {
  //...
  devServer: {
    ...
    host: '0.0.0.0',
    https: true
  }
};

Clean ZapWorks Studio Symbols

You may clean .zpp files using:

zapworks zppclean mySymbol.zpp

This command takes a ZPP file (the file format of ZapWorks Studio) and produces a new file without unnecessary or redundant data.