
Security News
/Research
Popular node-ipc npm Package Infected with Credential Stealer
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.
@onelinecode/onelinecode
Advanced tools

A collection of utilities and helpers following the principle: Keep it as simple as possible in one line of code.
As long as we area dealing with JavaScript, the library assumes that the user provides valid input. No type checking or other verifications of the arguments are part of the functions. The library tires to use the simplest and most performant code possible. To keep the functions as simple as possible they will be reduced to the core functionality: "one function should have one specific functionality only".
New functions will be added every time there is an article being published.
All functions are written in ESNext esmodules (./src) and available as
-umd (./dist/index.js) with the onelinecode namespace (e.g. window.onlinecode)
-commonjs (./dist/index.cjs.js)
-esm (./dist/index.esm.js)
isEmptyReturns a boolean false if the array is not empty or a boolean true if the array is empty.
lowestNumberReturns the lowest numerical item of the array.
removeDuplicatesReturns a copy of the array. Removes duplicate entries, keep in mind that it works only for entries with primitive values (string, number, bigint, boolean, undefined, symbol, and null). Preserves the order of the entries.
occurrenceMapReturns an object where the keys are the array entries and the values the number of their occurrences.
$ npm install @oneliner
$ yarn add @oneliner
For example, you want to shallowClone an array:
import { shallowClone } from '@oneliner/array';
let array = [1];
let arrayClone = shallowClone(array);
The library has 100% code coverage with ava and passes the build on (travis-ci.com)]|
If you are interested in discussion a specific function, please see the corresonding article from (the series on dev.to)[https://dev.to/martinkr/series/15146].
Please don't hesitate to comment, give feedback. I appreciate every input or comment. We can and should learn from each others opinion and knowledge. Please stick to a respectful style of discussion and read the (code of conduct)[] like the articles or star the repository.
Licensed under the MIT license. MIT - http://www.opensource.org/licenses/mit-license.php
FAQs
Awesome javascript in one line of code
The npm package @onelinecode/onelinecode receives a total of 75 weekly downloads. As such, @onelinecode/onelinecode popularity was classified as not popular.
We found that @onelinecode/onelinecode demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
/Research
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.

Security News
TeamPCP and BreachForums are promoting a Shai-Hulud supply chain attack contest with a $1,000 prize for the biggest package compromise.

Security News
Packagist urges PHP projects to update Composer after a GitHub token format change exposed some GitHub Actions tokens in CI logs.