WeatherHub

所属分类:救灾/预报
开发工具:CSS
文件大小:4167KB
下载次数:0
上传日期:2022-10-27 12:58:18
上 传 者sh-1993
说明:  WeatherHub,,气象中心,,
(WeatherHub,,)

文件列表:
index.js (1528, 2023-08-27)
node_modules (0, 2023-08-27)
node_modules\.bin (0, 2023-08-27)
node_modules\.bin\ejs (296, 2023-08-27)
node_modules\.bin\ejs.cmd (302, 2023-08-27)
node_modules\.bin\ejs.ps1 (781, 2023-08-27)
node_modules\.bin\jake (298, 2023-08-27)
node_modules\.bin\jake.cmd (303, 2023-08-27)
node_modules\.bin\jake.ps1 (785, 2023-08-27)
node_modules\.bin\mime (290, 2023-08-27)
node_modules\.bin\mime.cmd (299, 2023-08-27)
node_modules\.bin\mime.ps1 (769, 2023-08-27)
node_modules\.bin\sshpk-conv (308, 2023-08-27)
node_modules\.bin\sshpk-conv.cmd (308, 2023-08-27)
node_modules\.bin\sshpk-conv.ps1 (805, 2023-08-27)
node_modules\.bin\sshpk-sign (308, 2023-08-27)
node_modules\.bin\sshpk-sign.cmd (308, 2023-08-27)
node_modules\.bin\sshpk-sign.ps1 (805, 2023-08-27)
node_modules\.bin\sshpk-verify (312, 2023-08-27)
node_modules\.bin\sshpk-verify.cmd (310, 2023-08-27)
node_modules\.bin\sshpk-verify.ps1 (813, 2023-08-27)
node_modules\.bin\uuid (294, 2023-08-27)
node_modules\.bin\uuid.cmd (301, 2023-08-27)
node_modules\.bin\uuid.ps1 (777, 2023-08-27)
node_modules\.package-lock.json (43158, 2023-08-27)
node_modules\accepts (0, 2023-08-27)
node_modules\accepts\HISTORY.md (5096, 2023-08-27)
node_modules\accepts\LICENSE (1167, 2023-08-27)
node_modules\accepts\index.js (5252, 2023-08-27)
node_modules\accepts\package.json (1157, 2023-08-27)
node_modules\ajv (0, 2023-08-27)
node_modules\ajv\.tonic_example.js (439, 2023-08-27)
node_modules\ajv\LICENSE (1090, 2023-08-27)
node_modules\ajv\dist (0, 2023-08-27)
node_modules\ajv\dist\ajv.bundle.js (272665, 2023-08-27)
node_modules\ajv\dist\ajv.min.js (121997, 2023-08-27)
node_modules\ajv\dist\ajv.min.js.map (140201, 2023-08-27)
... ...

# ms [![Build Status](https://travis-ci.org/zeit/ms.svg?branch=master)](https://travis-ci.org/zeit/ms) [![Slack Channel](http://zeit-slackin.now.sh/badge.svg)](https://zeit.chat/) Use this package to easily convert various time formats to milliseconds. ## Examples ```js ms('2 days') // 172800000 ms('1d') // 8***00000 ms('10h') // 36000000 ms('2.5 hrs') // 9000000 ms('2h') // 7200000 ms('1m') // 60000 ms('5s') // 5000 ms('1y') // 31557600000 ms('100') // 100 ``` ### Convert from milliseconds ```js ms(60000) // "1m" ms(2 * 60000) // "2m" ms(ms('10 hours')) // "10h" ``` ### Time format written-out ```js ms(60000, { long: true }) // "1 minute" ms(2 * 60000, { long: true }) // "2 minutes" ms(ms('10 hours'), { long: true }) // "10 hours" ``` ## Features - Works both in [node](https://nodejs.org) and in the browser. - If a number is supplied to `ms`, a string with a unit is returned. - If a string that contains the number is supplied, it returns it as a number (e.g.: it returns `100` for `'100'`). - If you pass a string with a number and a valid unit, the number of equivalent ms is returned. ## Caught a bug? 1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device 2. Link the package to the global module directory: `npm link` 3. Within the module you want to test your local development instance of ms, just link it to the dependencies: `npm link ms`. Instead of the default one from npm, node will now use your clone of ms! As always, you can run the tests using: `npm test`

近期下载者

相关文件


收藏者