Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@hckrnews/enum
Advanced tools
npm install @hckrnews/enum
or
yarn add @hckrnews/enum
npm run test
or
yarn test
import { Enum } from '@hckrnews/enum'
class Example extends Enum {
static test = 'TEXT'
static another = 42
}
Example.test // 'TEXT'
Example.options // { test: 'TEXT', another: 42 }
Example.options.test // 'TEXT'
const example = Example.fromKey('test')
example.key // 'test'
example.value // 'TEXT'
example.values // [ 'TEXT', 42 ]
example.keys // [ 'test', 'another ]
example.test // 'TEXT'
example.another // 42
example.length // 2
example.name // 'Example'
example.is(Example.test) // true
example.is('TEXT') // true
example.is(42) // false
example.in([Example.test]) // true
example.in(['TEXT']) // true
example.in([42]) // false
example.valueOf() // 42
example.toString() // 'test'
example.toJSON() // 'test'
JSON.stringify(example) // '"test"'
const example = Example.create('test')
example.key // 'test'
example.value // 'TEXT'
const example = Example.fromValue('TEXT')
example.key // test
example.value // TEXT
Example.hasKey('test') // teue
Example.hasKey('TEXT') // false
Example.hasValue('test') // teue
Example.hasValue('TEXT') // false
Example.toJSON() // { test: 'TEXT', another: 42 }
JSON.stringify(Example) // '{"test":"TEXT","another":42}'
const example = Example.create('test', { output: 'value' })
example.valueOf() // 42
example.toString() // '42'
example.toJSON() // 42
JSON.stringify(example) // '42'
FAQs
Create vanilla JavaScript enums
We found that @hckrnews/enum demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.