npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

gs-mobile-cordova-plugin-jslib

v1.2.3

Published

GS Mobile JSLib

Downloads

15

Readme

gs-mobile-cordova-plugin-jslib

Installation

cordova plugin add gs-mobile-cordova-plugin-jslib

Utility

Kind: global class

new Utility()

This represents the mobile device, and provides properties for inspecting the model, version, UUID of the phone, etc.

utility.getInfo(successCallback, errorCallback)

取得行動裝置資訊

Kind: instance method of Utility

| Param | Type | Description | | --- | --- | --- | | successCallback | function | The function to call when the heading data is available | | errorCallback | function | The function to call when there is an error getting the heading data. (OPTIONAL) |

utility.leftPad(value, length) ⇒ String

leftPad(1,3)

Kind: instance method of Utility
Summary: 固定n位數, 不足補0
Returns: String - str 001

| Param | Type | Description | | --- | --- | --- | | value | int | 傳入值 | | length | int | n位數 |

utility.formatNumber(number, point) ⇒ String

formatNumber(1234.123, 2)

Kind: instance method of Utility
Summary: 格式化數字補千分位,固定小數n位
Returns: String - num 1,234.12

| Param | Type | Description | | --- | --- | --- | | number | String | 傳入值 | | point | String | 固定小數n位 |

utility.yyyy2yyy() ⇒ String

yyyy2yyy('2020年01月02日')

Kind: instance method of Utility
Summary: 西元年轉民國年
Returns: String - 109年01月02日

utility.yyy2yyyy() ⇒ String

yyyy2yyy('107年01月02日')

Kind: instance method of Utility
Summary: 民國年轉西元年
Returns: String - 2020年01月02日

utility.getCurrentDate() ⇒ String

Kind: instance method of Utility
Summary: 取得當下民國日期
Returns: String - 109年01月02日

utility.getCurrentDateDiff(diff) ⇒ String

getCurrentDateDiff(2) 假設當下是2020/01/03

Kind: instance method of Utility
Summary: 取得當下日期減天數
Returns: String - 傳回就是2020/01/01

| Param | Type | Description | | --- | --- | --- | | diff | String | 欲減掉的天數 |

utility.getCurrentTime() ⇒ String

Kind: instance method of Utility
Summary: 取得當下時間(時跟分)
Returns: String - 18時10分

utility.getLastMonthCurrentDate(num) ⇒ String

假設當天是109/01/02

Kind: instance method of Utility
Summary: 取得N個月前的當天
Returns: String - 回傳108/12/02

| Param | Type | Description | | --- | --- | --- | | num | String | 往前n個月 |

utility.getNextMonthCurrentDate(num) ⇒ String

假設當天是109/01/02

Kind: instance method of Utility
Summary: 取得N個月後的當天
Returns: String - 回傳109/02/02

| Param | Type | Description | | --- | --- | --- | | num | String | 往後n個月 |

utility.getParameterByName(name, num) ⇒ String

假設網址(url)是https://a.b.c/xxx.aspx?x=val1&y=val2, getParameterByName(y,url)

Kind: instance method of Utility
Summary: 取得網址參數的值
Returns: String - 回傳y的值是val2

| Param | Type | Description | | --- | --- | --- | | name | String | 欲取得的參數名稱 | | num | String | 完整的網址 |

utility.twd97_to_latlng($x, $y) ⇒ array

Kind: instance method of Utility
Summary: TWD97轉WGS84
Returns: array - 回傳WGS84坐標陣列

| Param | Type | Description | | --- | --- | --- | | $x | float | TWD97 x坐標 | | $y | float | TWD97 y坐標 |