fish-helper 0.0.38 → 0.0.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -33
- package/package.json +31 -30
package/README.md
CHANGED
|
@@ -6,36 +6,21 @@ npm install fish-helper
|
|
|
6
6
|
const helper = require('fish-helper')
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
> - format_count({num, divide, suffix, show_suffix_always}) ------- return <strong>num</strong> or String or 0
|
|
28
|
-
>
|
|
29
|
-
> - format_num2date(timestamp) ------- convert time to Object; return Object that include keys: day、hour、minute、seconds
|
|
30
|
-
>
|
|
31
|
-
> - count_down(date, fn) ------- End time countdown, end time can be passed in by itself; fn is a callback function that takes a remaining time argument; return a function to stop the timer
|
|
32
|
-
>
|
|
33
|
-
> - count_down_by_remain_seconds(fn, seconds) ------- 60-second countdown. Time can pass by itself
|
|
34
|
-
>
|
|
35
|
-
> - format_thousandth(num) ------- format the data as a string with thousands of bits
|
|
36
|
-
>
|
|
37
|
-
> - is_empty(data) ------- determines whether the data is empty
|
|
38
|
-
>
|
|
39
|
-
> - poll(fn, minute) ------- Execute fn function every minute, return funtion to stop the fn
|
|
40
|
-
> -
|
|
41
|
-
> - is_equal(a, b) ------- return boolean, compare a and b; a and b are any type of data
|
|
9
|
+
| Method | Description |
|
|
10
|
+
|-----------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
11
|
+
| `add(hour, start)` | Add hour from start date, return timestamp. |
|
|
12
|
+
| `offset_time(date, type)` | The time difference (absolute value), returns the corresponding string. |
|
|
13
|
+
| `before_lt_hour(date, hour)` | The date is less than now, and the date is less than hour from now. |
|
|
14
|
+
| `before_gt_hour(date, hour)` | The date is less than now, and the date is greater than hour from now. |
|
|
15
|
+
| `after_lt_hour(date, hour)` | The date is greater than now, and the date is less than hour from now. |
|
|
16
|
+
| `after_gt_hour(date, hour)` | The date is greater than now, and the date is greater than hour from now. |
|
|
17
|
+
| `is_current_year(date)` | Return boolean. |
|
|
18
|
+
| `get_time_obj(date)` | Return object that includes keys: year, month, day, hour, minute, seconds, day_of_week. |
|
|
19
|
+
| `format_count({num, divide, suffix, show_suffix_always})` | Return num or string or 0. |
|
|
20
|
+
| `format_num2date(timestamp)` | Convert time to object; return object that includes keys: day, hour, minute, seconds. |
|
|
21
|
+
| `count_down(date, fn)` | End time countdown, end time can be passed in by itself; fn is a callback function that takes a remaining time argument; return a function to stop the timer. |
|
|
22
|
+
| `count_down_by_remain_seconds(fn, seconds)` | 60-second countdown. Time can pass by itself. |
|
|
23
|
+
| `format_thousandth(num)` | Format the data as a string with thousands of bits. |
|
|
24
|
+
| `is_empty(data)` | Determines whether the data is empty. |
|
|
25
|
+
| `poll(fn, minute)` | Execute fn function every minute, return function to stop the fn. |
|
|
26
|
+
| `is_equal(a, b)` | Return boolean, compare a and b; a and b are any type of data. |
|
package/package.json
CHANGED
|
@@ -1,32 +1,33 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
2
|
+
"name": "fish-helper",
|
|
3
|
+
"private": false,
|
|
4
|
+
"version": "0.0.39",
|
|
5
|
+
"main": "build/helper.cjs.js",
|
|
6
|
+
"module": "build/helper.es.js",
|
|
7
|
+
"types": "build/types/index.d.ts",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"keywords": [
|
|
10
|
+
"Time processing tool"
|
|
11
|
+
],
|
|
12
|
+
"description": "a tool to process time",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"require": "./build/helper.cjs.js",
|
|
16
|
+
"import": "./build/helper.es.js",
|
|
17
|
+
"types": "./build/types/index.d.ts"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"build"
|
|
22
|
+
],
|
|
23
|
+
"scripts": {},
|
|
24
|
+
"author": {
|
|
25
|
+
"name": "weixin_38726348"
|
|
26
|
+
},
|
|
27
|
+
"repository": {
|
|
28
|
+
"url": "https://gitcode.net/weixin_38726348/util.git"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"rollup": "^3.10.0"
|
|
32
|
+
}
|
|
32
33
|
}
|