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

@bellmann/pcb.js

v0.0.5

Published

pcb.js is a browser implementation of pcb-stackup. It takes both local and remote zip-files as input and converts it to SVG images. We aim to support other sources of input in the future too.

Downloads

16

Readme

pcb.js

pcb.js is a browser implementation of pcb-stackup. It takes both local and remote zip-files as input and converts it to SVG images. We aim to support other sources of input in the future too.

Install with:

$ npm install

or build your own version with the help of browserify:

npm run build-dist

This will create pcb.js in the dist folder.

Usage

var gerbers = { remote: url };
var options = { id: 'my-board' };
var circuitboard = pcbjs(gerbers, options).then(function process(pcb) {
  // pcb contains board_layers, board_width, board_length and the pcb-stackup
  // object, e.g. pcb.stackup.top.svg.
}).catch(function(error) {
  console.error(error)
});

Choosing your own id helps when styling the output with css.

Error handling

Errors are part of the Promise return by pcbjs. For example:

.catch(function(error) {
  if (error.message.match(/End of data reached/g)) {
    console.error('Incorrect zip file')
  }
});

Styling

See pcb-stackup-core docs for more details and additional colour options. Colours can be set in the options object.

You can also change the colour using css.

layer | classname | example (id = 'my-board') ------|-------------|------------------------------------------------- fr4 | id + _fr4 | .my-board_fr4 {color: #666;} cu | id + _cu | .my-board_cu {color: #ccc;} cf | id + _cf | .my-board_cf {color: #c93;} sm | id + _sm | .my-board_sm {color: #rgba(0, 66, 0, 0.75);} ss | id + _ss | .my-board_ss {color: #fff;} sp | id + _sp | .my-board_sp {color: #999;} out | id + _out | .my-board_out {color: #000;}

API

pcbjs(config, [options]): function

Parameter | Type | Description ----------|-------------------|------------ gerbers | | Gerber files options | | pcb-stackup-core options

gerbers: object

Name | Type | Default | Description ----------|----------|---------|------------ remote | string | | Set a remote file to process local | File | | Set a local File to process

remote will take precedence over local.

options: object

See pcb-stackup-core docs for more details and additional options

Development

We strongly believe in the power of open source. This module is our way of saying thanks.

If you want to contribute please:

  1. Fork the repository.
  2. Push to your fork and submit a pull request.

Releases

Our releases are created with the help of git-flow.

  1. Create a new release with git flow release start <VERSION>.
  2. Run npm run build-dist.
  3. Bump the version in package.json.
  4. Commit all changes.
  5. Finish the release with git flow release finish <VERSION>.
  6. Push to develop and master and include any tags.
  7. Publish the package to npm with npm publish --access public.