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

@stemn/whats-that-gerber

v2.1.2

Published

Guesses the PCB layer type given a filename of a Gerber or drill file

Downloads

9

Readme

what's that gerber?

GitHub issues npm Travis David David devDependencies

Identify the probable PCB layer type of a Gerber or drill file by its filename.

usage

var whatsThatGerber = require('whats-that-gerber')

var filename = 'my-board-F_Cu.gbr'
var layerType = whatsThatGerber(filename)              // 'tcu'
var layerName = whatsThatGerber.getFullName(layerType) // 'top copper'

layer types and names

There are 12 available layer types. You can get an array of all types with:

var whatsThatGerber = require('whats-that-gerber')
var allLayerTypes = whatsThatGerber.getAllTypes() // ['drw', 'tcu', ...]

type | full name (en)
-----|-------------------- drw | gerber drawing
tcu | top copper
tsm | top soldermask
tss | top silkscreen
tsp | top solderpaste
bcu | bottom copper
bsm | bottom soldermask
bss | bottom silkscreen
bsp | bottom solderpaste icu | inner copper
out | board outline
drl | drill hits

checking if a layer type is valid

You can check if any given string is a valid layer type with:

var whatsThatGerber = require('whats-that-gerber')
var isValidType = whatsThatGerber.isValidType

var type1 = 'tsm'
var type2 = 'hello'

console.log(isValidType(type1)) // true
console.log(isValidType(type2)) // false

full name locales

The full name method takes a locale string as its second parameter, which defaults to 'en':

var fullName = whatsThatGerber.getFullName('tcu', 'en')

Currently, no other locales are supported (because I don't know any!); contributions are greatly appreciated. If the type or locale is unrecognized, the result will be an empty string. Locale additions will be considered patch-level upgrades.

supported cad programs

We should be able to identify files output by the following programs:

  • KiCad
  • Eagle
  • Altium
  • Orcad
  • gEDA PCB

contributing

  1. $ git clone tracespace/whats-that-gerber
  2. $ npm install
  3. $ npm test

If adding / modifying a filetype matcher, please remember to add / modify an example filename in test/filenames-by-cad.json.