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

capacitance.js

v0.1.0

Published

Simple module to calculate electrical capacitance in series and parallel circuits.

Downloads

4

Readme

Table of Contents

Installation

$ npm install --save capacitance.js

Usage

const capacitance = require('capacitance.js');

capacitance([1, 2, 3], 'series');
//=> 0.5454545454545455

capacitance([1, 2, 3], 'parallel');
//=> 6

console.log([1, 2, 3], 'parallel') + 'F')
// 6F

API

capacitance(circuit, type)

circuit

Type: array

Description: Values of capacitors associated in your circuit.

Example: [1, 2, 3, 4]

type

Type: string

Description: Type of capacitors association in your circuit.

Options:

  • 'series' or 's': Capacitors in series.
  • 'parallel' or 'p': Capacitors in parallel.

Understand the Topic

Combinating capacitors is very common in many circuits, when we want to reach a capacitance level which only one capacitor is not enough.

Capacitors in Series

In an association of series capacitors, the equivalent capacitor is equal to the inverse of the sum of all the inverted capacitors which make up the association:

1 / Ceq = (1 / C1) + (1 / C2) + (1 / C3) + ... + (1 / Cn)

Capacitors in Parallel

In an association of parallel capacitors, the equivalent capacitor is equal to the sum of all capacitors that make up the association:

Ceq = C1 + C2 + C3 + ... + Cn

Development

All the tasks needed for development automation are defined in the package.json scripts property and can be run via:

npm run <command>

Here is a summary of all the commands:

| Command | Description | |---------------|------------------------------------------------------------------------------------------| | compile | Runs the Livescript compiler on the source. | | test | Runs Mocha in BDD mode. | | build | Runs both compile and test commands. |

Contributing

Contributions are very welcome! If you'd like to contribute, these guidelines may help you.

Motivation

I was studying capacitors association because of my Constant Current discipline and then decided to put the basics into practice.

License

capacitance.js is distributed under the MIT License, available in this repository. All contributions are assumed to be also licensed under the MIT License.