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

jsthermalcomfort

v0.2.0

Published

A JavaScript package to calculate thermophysiological, thermal comfort, thermal stress indices

Downloads

2

Readme

Overview

| docs | docs | | :-----------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | build | build | | tests | test | | page deployment | page deployment | | snyk security | synk | | license | license | | npm version | npm |

Package to calculate thermophysiological, thermal comfort, thermal stress indices, in JavaScript.

Please cite us if you use this package: Tartarini, F., Schiavon, S., 2020. pythermalcomfort: A Python package for thermal comfort research. SoftwareX 12, 100578. https://doi.org/10.1016/j.softx.2020.100578

Official Documentation Website

https://federicotartarini.github.io/jsthermalcomfort/

Installation

npm install jsthermalcomfort

If you want to use jsthermalcomfort package without installing it on your local machine, you can import with:

https://cdn.jsdelivr.net/gh/FedericoTartarini/jsthermalcomfort/lib/esm/

Example:

import {
  models,
  utilities,
  pschymetrics,
} from "https://cdn.jsdelivr.net/gh/FedericoTartarini/jsthermalcomfort/lib/esm/index.js";

You can also import it in the website directly, and caution that you need to mark the script as module:

<script type="module">
  import {
    models,
    utilities,
    pschymetrics,
  } from "https://cdn.jsdelivr.net/gh/FedericoTartarini/jsthermalcomfort/lib/esm/index.js";
</script>

Examples and Tutorials

We developed a few examples files on how to use some of the functions.

Here is a list of examples running in the browser:

Contributing

Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given.

Bug reports

When reporting a bug please include:

  • Your operating system name and version.
  • Any details about your local setup that might be helpful in troubleshooting.
  • Detailed steps to reproduce the bug.

Documentation improvements

If you find any issue in our online documentation please open an issue.

jsthermalcomfort could always use more documentation, whether as part of the official jsthermalcomfort docs, in JSDocs, or even on the web in blog posts, articles, and such.

Feature requests and feedback

The best way to send feedback is to file an issue at https://github.com/FedericoTartarini/jsthermalcomfort/issues

If you are proposing a feature:

  • Explain in detail how it would work.
  • Keep the scope as narrow as possible, to make it easier to implement.
  • Remember that this is a volunteer-driven project, and that code contributions are welcome :)

Local development

To set up jsthermalcomfort for local development:

  1. Fork jsthermalcomfort (look for the “Fork” button).

  2. Clone your fork locally. Fetch and pull all the updates from the master branch before you do anything:

    git clone [email protected]:FedericoTartarini/jsthermalcomfort.git

    We use git submodules to pull validation data for the tests, to ensure tests are successful please run:

    git submodule update --init --recursive
  3. Create a branch for local development. The naming rule for new branch are, as follows:

    • If this update is for a new feature Feature/feature_name_here
    • If this update is for bug fix Fix/bug_name_here
    • If this update is for documentation Documentation/doc_name_here

    You can create a branch locally using the following command. Make sure you only push updates to this new branch only:

    git checkout -b name-of-your-bugfix-or-feature

    Now you can make your changes locally.

  4. When you’re done making changes run all tests using Jest:

    • Install dependencies
    npm install
    npm run test
    • Run prettier to format your code:
    npm run format
    • Commit your changes:
    git add .
    git commit -m "Your detailed description of your changes."
    • Update the docs:
    npm run docs
    • Commit your documentation changes:
    git add .
    git commit -m "Your detailed description of your changes."
    • Push your branch to GitHub:
    git push origin name-of-your-bugfix-or-feature
  5. Submit a pull request after you have done all your modifications and tested your work. The pull request should include a detailed description of your work:

    • What this pull request is about
    • Have you tested your work
    • Will this work affect other component in the product

Pull Request Guidelines

If you need some code review or feedback while you’re developing the code just make the pull request.

For merging, you should:

  • Include passing tests (run npm run test).
  • Update documentation when there’s new API, functionality etc.

Documentation

We are using JSDoc and documentation.js to automatically build the documentation.

All the files needed to generate the documentation can be found in the docs_theme repository. After updating the Markdown files, please run the command:

npm run docs

Please ignore the docs folder, this folder contains all the files generated by the above command.

How to add a new model to jsthermalcomfort

  1. Add a file under src/models/ with the name of the function/model and document it.

  2. Add any related functions that are used by your function either in src/utilities/utilities.js or src/psychrometrics/. See existing code as example.

    • In order to add a new function/API to the library you should mark that function as @public, add it to its corresponding category, for example for models you should do @memberof models, and lastly you should give it a proper name for the documentation with @docname, for example: @docname Clothing prediction. It is important to note that you should also add the @public tag to any types the function exposes/uses.
  3. Test your function by writing a test in tests/models/<name_of_model>.test.js.

  4. To run a subset of tests you can do the following:

    npm run test -- '<path_to_test_file>' -t '<test_pattern/name>'

If you are using VSCode you can use the Jest Runner extension to easily run subset of tests.

How to publish a new version of jsthermalcomfort

To create a new release do the following:

  1. Update the package.json version to the new version (we use the semantic release system for versioning)
  2. Run npm run build to update the lib directory (output with types of the library that gets published to NPM)
  3. Commit the updates
  4. In GitHub go to Releases -> click Draft a new release
  5. Click Choose a tag and type the new version, for example v0.1.1
  6. Write the title and description and click Publish release
  7. This will trigger a GitHub action that will publish the new version to NPM