Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ruslanguns/npm-cronometro
https://github.com/ruslanguns/npm-cronometro
Last synced: 7 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/ruslanguns/npm-cronometro
- Owner: ruslanguns
- License: mit
- Created: 2019-02-20T00:42:08.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T08:16:31.000Z (11 months ago)
- Last Synced: 2024-05-28T17:07:53.228Z (6 months ago)
- Language: JavaScript
- Size: 1.06 MB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Cronometro y Temporizador Js
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/f1edbe02f76a4409880bb582e37dfe3c)](https://app.codacy.com/app/ruslanguns/anartz-npm-2c-cronometro?utm_source=github.com&utm_medium=referral&utm_content=ruslanguns/anartz-npm-2c-cronometro&utm_campaign=Badge_Grade_Settings)
[![Build Status](https://travis-ci.org/ruslanguns/anartz-npm-2c-cronometro.svg?branch=master)](https://travis-ci.org/ruslanguns/anartz-npm-2c-cronometro)
[![npm version](https://badge.fury.io/js/proj-2c-cronometro.svg)](https://badge.fury.io/js/proj-2c-cronometro)
[![Documentation](https://raw.githubusercontent.com/ruslanguns/anartz-npm-2c-cronometro/master/documentation/images/coverage-badge-documentation.svg?sanitize=true)](https://github.com/ruslanguns/anartz-npm-2c-cronometro/tree/master/documentation)
[![Coverage Status](https://coveralls.io/repos/github/ruslanguns/anartz-npm-2c-cronometro/badge.svg?branch=master)](https://coveralls.io/github/ruslanguns/anartz-npm-2c-cronometro?branch=master)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)Una libreria hecha en node con typescript básica que cuenta y descuenta la cantidad de segundos que se envía.
## Instalación
```
npm install proj-2c-cronometro
```## Modo de uso
### Cronómetro contador
```typescript
const modulo = require('./dist');const cont = new modulo.Contador(5);
var d = cont.start().subscribe(
data => {
console.log(data);
if (data === 'FINISH') {
d.unsubscribe();
}
}
);/*
// Espera estos resultados
00:00:00
00:00:01
00:00:02
00:00:03
00:00:04
00:00:05
FINISH
*/
```### Temporizador descontador
```typescriptconst desc = new modulo.Descontador(5);
var de = desc.start().subscribe(
data => {
console.log('D', data);
if (data === 'FINISH') {
de.unsubscribe();
}
}
);/*
// Espera estos resultados
00:00:04
00:00:03
00:00:02
00:00:01
FINISH
*/
```