如何快速查询模块的函数?
命令列下有什麼方式可以快速查詢模塊內的函數嗎? 目前缺點
- 需要安裝後才能查詢
- 只能查詢單一模塊 期待: 能否類似 Linux 底下的 man page。
例如:要查詢 utility 需要先安裝,才能查詢 utility 的函數。
> npm install utility
執行後
> node -pe "require('utility')"
便底下列出了 utility 的函數
{
noop: [Function: noop],
getParamNames: [Function: getParamNames],
setImmediate: [Function: setImmediate] {
[Symbol(util.promisify.custom)]: [Function]
},
try: [Function],
UNSTABLE_METHOD: { try: [Function] },
dig: [Function],
argumentsToArray: [Function],
hash: [Function: hash],
md5: [Function: md5],
sha1: [Function: sha1],
sha256: [Function: sha256],
hmac: [Function: hmac],
base64encode: [Function: base64encode],
base64decode: [Function: base64decode],
MAX_SAFE_INTEGER: 9007199254740991,
MIN_SAFE_INTEGER: -9007199254740991,
MAX_SAFE_INTEGER_STR: '9007199254740991',
isSafeNumberString: [Function: isSafeNumberString],
toSafeNumber: [Function: toSafeNumber],
random: [Function: random],
randomString: [Function: randomString],
split: [Function: split],
splitAlwaysOptimized: [Function: splitAlwaysOptimized],
replace: [Function: replace],
replaceInvalidHttpHeaderChar: [Function: replaceInvalidHttpHeaderChar],
includesInvalidHttpHeaderChar: [Function: includesInvalidHttpHeaderChar],
randomSlice: [Function: randomSlice],
spliceOne: [Function: spliceOne],
strictJSONParse: [Function],
readJSONSync: [Function],
writeJSONSync: [Function],
readJSON: [Function],
writeJSON: [Function],
accessLogDate: [Function],
YYYYMMDDHHmmssSSS: [Function],
logDate: [Function],
YYYYMMDDHHmmss: [Function],
YYYYMMDD: [Function: YYYYMMDD],
datestruct: [Function],
timestamp: [Function: timestamp],
assign: [Function],
has: [Function: has],
getOwnEnumerables: [Function: getOwnEnumerables],
map: [Function: map],
escape: [Function: escapeHtml],
unescape: [Function: unescape] {
chars: {
'"': '"',
'"': '"',
''': "'",
''': "'",
'&': '&',
'&': '&',
'>': '>',
'>': '>',
'<': '<',
'<': '<'
},
extras: {
'¢': '¢',
'¢': '¢',
'©': '©',
'©': '©',
'€': '€',
'€': '€',
'£': '£',
'£': '£',
'®': '®',
'®': '®',
'¥': '¥',
'¥': '¥'
}
},
encodeURIComponent: [Function: encodeURIComponent_],
decodeURIComponent: [Function: decodeURIComponent_]
}
有比較方便的方式嗎?