Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vdegenne/stringytime
Utility package to convert human readable timestrings to various time values.
https://github.com/vdegenne/stringytime
Last synced: about 1 month ago
JSON representation
Utility package to convert human readable timestrings to various time values.
- Host: GitHub
- URL: https://github.com/vdegenne/stringytime
- Owner: vdegenne
- Created: 2020-01-26T01:48:07.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T05:44:23.000Z (almost 2 years ago)
- Last Synced: 2023-03-02T00:42:04.927Z (almost 2 years ago)
- Language: JavaScript
- Size: 399 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# stringytime
Utility package to convert human readable timestrings to various time values.
```javascript
const stringytime = require('stringytime');stringytime.toMilliseconds('1m'); // returns 60000
stringytime.toMs('1m'); // alias
```You can use the `s` for second(s), `m` for minute(s), `h` for hour(s), `d` for day(s), `M` for month(s) and `y` for year(s).
## Installation
```
npm i stringytime
```*note: it supports CJS, TypeScript and ES6 modules syntaxes.*
## Project State
I made this very quickly as a personal module to load in my external apps. So for now there is only this function implemented. But if you are interested about the idea, I accept PRs.