Installations
npm install util-ex
Score
88.9
Supply Chain
100
Quality
85.3
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Developer
snowyu
Developer Guide
Module System
CommonJS
Min. Node Version
>=8
Typescript Support
Yes
Node Version
18.19.0
NPM Version
10.2.3
Statistics
113 Commits
2 Watching
2 Branches
1 Contributors
Updated on 07 May 2024
Bundle Size
27.23 kB
Minified
7.84 kB
Minified + Gzipped
Languages
JavaScript (97.44%)
CoffeeScript (2.56%)
Total Downloads
Cumulative downloads
Total Downloads
5,762,422
Last day
9.2%
9,132
Compared to previous day
Last week
23.2%
60,478
Compared to previous week
Last month
1.8%
226,134
Compared to previous month
Last year
312.8%
2,496,075
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
util-ex
Enhanced utils
This package modifies and enhances the standard util
from node.js
API
Full API Documents is here: Docs
newFunction
newFunction(name, arguments, body[, scope[, values]])
newFunction(functionString[, scope[, values]])
create a function via string.
1newFunction = require('util-ex/lib/new-function')
2
3var fn = newFunction('yourFuncName', ['arg1', 'arg2'], 'return log(arg1+arg2);', {log:console.log})
4newFunction('function yourFuncName(){}')
5newFunction('function yourFuncName(arg1, arg2){return log(arg1+arg2);}', {log:console.log})
6newFunction('function yourFuncName(arg1, arg2){return log(arg1+arg2);}', ['log'], [console.log])
7
8//fn.toString() is :
9/*
10 "function yourFuncName(arg1, arg2) {
11 return log(arg1+arg2);
12 }"
13*/
defineProperty
defineProperty(object, key, value[, aOptions])
Define a property on the object. move to inherits-ex package.
usage
1const defineProperty = require('util-ex/lib/defineProperty') 2 3let propValue = '' 4const obj = {} 5 6defineProperty(obj, 'prop', 'simpleValue') 7defineProperty(obj, 'prop', undefined, { 8 get() {return propValue} 9 set(value) {propValue = value} 10})
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
GitHub workflow tokens follow principle of least privilege
Details
- Info: topLevel 'contents' permission set to 'read': .github/workflows/static.yml:15
- Info: no jobLevel write permissions found
Reason
license file detected
Details
- Info: project has a license file: LICENSE-MIT:0
- Info: FSF or OSI recognized license: MIT License: LICENSE-MIT:0
Reason
3 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5
- Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/static.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/snowyu/util-ex.js/static.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/static.yml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/snowyu/util-ex.js/static.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/static.yml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/snowyu/util-ex.js/static.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/static.yml:57: update your workflow using https://app.stepsecurity.io/secureworkflow/snowyu/util-ex.js/static.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/static.yml:59: update your workflow using https://app.stepsecurity.io/secureworkflow/snowyu/util-ex.js/static.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/static.yml:64: update your workflow using https://app.stepsecurity.io/secureworkflow/snowyu/util-ex.js/static.yml/master?enable=pin
- Warn: npmCommand not pinned by hash: .github/workflows/static.yml:43
- Info: 0 out of 5 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 1 third-party GitHubAction dependencies pinned
- Info: 0 out of 1 npmCommand dependencies pinned
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Score
4.1
/10
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More