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

@jscad/cli

v2.3.4

Published

Command Line Interface (CLI) for JSCAD

Downloads

347

Readme

@jscad/cli : JSCAD Command Line Interface (CLI)

This is the Command Line Interface (CLI) application for creating designs using Node.js.

NPM version NPM downloads Build Status Stability License

User Group Lerna JavaScript Style Guide

Backers Sponsors

Table of Contents

Usage

The next steps require NPM and Node.js. The JSCAD project always develops with the latest LTS releases, so install these versions.

Install the CLI for General Use

The CLI can be installed for general use using NPM.

npm install -g @jscad/cli

Once installed, the CLI can be invoked using

jscad -v
jscad

Install the CLI as Part of a Project

If a general installation is not possible or desired, then installation as part of a project is possible.

cd myproject
npm install -D @jscad/cli

This will add the CLI package as a development dependency. The CLI can be invoked using

npx jscad -v
npx jscad

These two commands will show the version of the CLI, and a general help message.

Using the CLI

Simply invoke 'jscad' using various options. Here are some examples.

Examples:

jscad mydesign.js # -- convert mydesign.js to mydesign.stl as default

jscad mydesign.js -o test.stl # -- convert mydesign.js to test.stl

jscad frog.stl -o test.js # -- convert frog.stl to test.js

jscad mydesign.js -of amf # -- convert mydesign.js into mydesign.amf

For multi-part models, you can pass the generateParts flag -gp to output each part as a separate, numbered file:

jscad mydesign.js -gp # -- convert mydesign.js into mydesign-part-1-of-2.stl and mydesign-part-2-of-2.stl

You may also pass the zip flag -z to zip generated files into one .zip file:

jscad mydesign.js -z # -- convert mydesign.js into mydesign.zip which contains: mydesign.stl

jscad mydesign.js -gp -z # -- convert mydesign.js into mydesign.zip which contains: mydesign-part-1-of-2.stl and mydesign-part-2-of-2.stl

The '-o' option can be used to control where the output will be placed. While, the '-of' option can be used to control the format of the output.

You can also provide the parameters to a design by passing -- to the CLI.

jscad mydesign.js --name "Just Me" --title "Geek" -o output.stl

Also, design projects (directories) can be used as the input to the CLI.

jscad myproject/ -o ./test.stl # -- convert the project mydesign to test.stl

Note: The CLI will search for the design entry point just like NPM.

  • if there is a package.json file in the project, then try to load the 'main' property
  • if not, then try to load from 'index.js'

Using the CLI with the JSCAD Examples

The easiest way to use the examples is to create a new NPM project.

mkdir newproject
cd newproject
npm init

Then add both the examples and the CLI to the project.

npm install @jscad/examples
npm install @jscad/cli

And finally, make the examples local to the project.

ln -s node_modules/@jscad/examples ./examples

The examples are just single file designs, or multiple file projects.

npx jscad examples/core/booleans/basicBooleans.js -o ./test.stl
npx jscad examples/module-design/ -of dxf

Documentation

Contributing

The various JSCAD packages and all source code are part of the JSCAD Organization, and maintained by a group of volunteers. We welcome and encourage anyone to pitch in but please take a moment to read the following guidelines.

  • If you want to submit a bug report please make sure to follow the Reporting Issues guide. Bug reports are accepted as Issues via GitHub.

  • If you want to submit a change or a patch, please read the Contributing Guide. New contributions are accepted as Pull Requests via GitHub.

  • We only accept bug reports and pull requests on GitHub.

  • If you have a question about how to use JSCAD, then please start a conversation at the JSCAD User Group. You might find the answer in the JSCAD User Guide.

  • If you have a change or new feature in mind, please start a conversation with the Core Developers and start contributing changes.

Small Note: If editing this README, please conform to the standard-readme specification.

Community

See for more details

Backers

Thank you to all our backers! 🙏 [Become a backer]

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]

License

The MIT License (MIT) (unless specified otherwise)