Gathering detailed insights and metrics for obj-def
Gathering detailed insights and metrics for obj-def
Gathering detailed insights and metrics for obj-def
Gathering detailed insights and metrics for obj-def
npm install obj-def
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
3 Stars
29 Commits
2 Forks
3 Watching
1 Branches
3 Contributors
Updated on 10 Jan 2021
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-14.4%
8,811
Compared to previous day
Last week
1.8%
50,475
Compared to previous week
Last month
1.5%
214,523
Compared to previous month
Last year
102.6%
2,856,279
Compared to previous year
1
Easily set default fields in objects.
1# Using npm 2npm install --save obj-def 3 4# Using yarn 5yarn add obj-def
1const objDef = require("obj-def"); 2 3let foo = { 4 bar: 42 5}; 6 7// "bar" will remain unchanged 8objDef(foo, "bar", 7); 9 10// "location" will default to "Mars" 11objDef(foo, "location", "Mars"); 12 13console.log(foo); 14// => { bar: 42, location: 'Mars' }
There are few ways to get help:
objDef(obj, field, defValue, opts)
Easily set default fields in objects.
obj
: The input object.field
: The field name.defValue
: The default value.opts
: The deffy
options.Have an idea? Found a bug? See how to contribute.
I open-source almost everything I can, and I try to reply to everyone needing help using these projects. Obviously, this takes time. You can integrate and use these projects in your applications for free! You can even change the source code and redistribute (even resell it).
However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it:
Starring and sharing the projects you like :rocket:
—I love books! I will remember you after years if you buy me one. :grin: :book:
—You can make one-time donations via PayPal. I'll probably buy a coffee tea. :tea:
—Set up a recurring monthly donation and you will get interesting news about what I'm doing (things that I don't share with everyone).
Bitcoin—You can send me bitcoins at this address (or scanning the code below): 1P9BRsmazNQcuyTxEqveUsnf5CERdq35V6
Thanks! :heart:
If you are using this library in one of your projects, add it in this list. :sparkles:
scrape-it
one-by-one
scrape-it-plus
@slikts/scrape-it
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 0/14 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 effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-25
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