wmt-breathing-exercise
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

wmt-breathing-exercise

This module is a React BreathingExercise component used for inhale/exhale breathing with a seconds timer and breathing cycles count.

Setting up the module

  • git clone git@bitbucket.org:wmtp/wmt-breathing-exercise.git
  • cd wmt-breathing-exercise
  • npm install

Building the module

The module uses Typescript compiler (TSC) to compile the source code. To build the project run the following command:

  • npm run build

Installing the module for testing

You can install the module into your own React project as a dependency. After you clone the module you can install using the following command:

  • npm install /absolute/path/to/wmt-breathing-exercise
  • i.e. -> npm install /Users/wmt/Documents/projects/npm/wmt-breathing-exercise

Installing the module from npm

Use the following command to install from npm:

  • npm install wmt-breathing-exercise

Importing the module

Once you have the module installed you can import the exported component into your code like so:

import BreathingExercise from 'wmt-breathing-exercise';

Using the module

Example of using the module:

<BreathingExercise
  breathingCycles={8}
  exhaleSeconds={3}
  inhaleSeconds={3}
  redirectButtonRoute="home"
  redirectButtonText="Home"
/>
  • breathingCycles: Number of breathing cycles
  • exhaleSeconds: Exhale length in seconds
  • inhaleSeconds: Inhale length in seconds
  • redirectButtonRoute: Redirect button route
  • redirectButtonText: Redirect button text

Testing

  • Tests can be ran with the npm test command.
  • Tests are ran using Jest with Enzyme - More information about getting started with Jest can be found here.

Example render test:

it('renders without crashing', () => {
    shallow(<BreathingExercise />);
});`

Viewing API docs

You can generate and view the API docs by running the following command:

  • npm run docs

This will start a development server on localhost:6060 showing all the properties for the BreathingExercise component.

You can also view the docs which are hosted here: https://wmtp.bitbucket.io/ReactModules/docs/#/BreathingExercise

Viewing source code

https://bitbucket.org/wmtp/wmt-breathing-exercise

Published module

Here is where the module is currently published: https://www.npmjs.com/package/wmt-breathing-exercise

License

This project is licensed under the MIT License.

Readme

Keywords

none

Package Sidebar

Install

npm i wmt-breathing-exercise

Weekly Downloads

2

Version

1.0.2

License

MIT

Unpacked Size

32 kB

Total Files

12

Last publish

Collaborators

  • wmt-sdk