# sec

> Convert a time string to seconds: `'00:22:17'` → `1337`

Latest version **2.0.0** (published 2021-05-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install sec
pnpm add sec
yarn add sec
bun add sec
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2021-05-03 |
| First published | 2015-05-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >=12 |
| Dependencies | 0 |
| Unpacked size | 2.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | second, seconds, time, string, data, hms, hour, minute, convert |

## Links

- npm: https://www.npmjs.com/package/sec
- Repository: https://github.com/sindresorhus/sec
- Homepage: https://github.com/sindresorhus/sec#readme
- Issues: https://github.com/sindresorhus/sec/issues
- Funding: https://github.com/sponsors/sindresorhus
- npm.io page: https://npm.io/package/sec

## Recent versions

- 2.0.0 (latest) — 2021-05-03
- 1.0.0 — 2015-05-30

## README

# sec

> Convert a time string to seconds: `'00:22:17'` → `1337`

## Install

```
$ npm install sec
```

## Usage

```js
import toSeconds from 'sec';

// hours:minutes:seconds
toSeconds('00:22:17');
//=> 1337

toSeconds('22:17');
//=> 1337

toSeconds('17');
//=> 17
```

---
_Source: https://npm.io/package/sec · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
