![Malicious npm Package Typosquats react-login-page to Deploy Keylogger](https://cdn.sanity.io/images/cgdhsj6q/production/007b21d9cf9e03ae0bb3f577d1bd59b9d715645a-1024x1024.webp?w=400&fit=max&auto=format)
Research
Security News
Malicious npm Package Typosquats react-login-page to Deploy Keylogger
Socket researchers unpack a typosquatting package with malicious code that logs keystrokes and exfiltrates sensitive data to a remote server.
peer-info
Advanced tools
Changelog
Readme
> npm i peer-info
const PeerInfo = require('peer-info')
<script>
TagLoading this module through a script tag will make the PeerInfo
obj available in the global namespace.
<script src="https://unpkg.com/peer-info/dist/index.min.js"></script>
<!-- OR -->
<script src="https://unpkg.com/peer-info/dist/index.js"></script>
const PeerInfo = require('peer-info')
const peer = new PeerInfo()
// TCP port 5001
peer.multiaddrs.add('/ip4/1.2.3.4/tcp/5001')
// UDP port 8001
peer.multiaddrs.add('/ip4/1.2.3.4/udp/8001')
// mic/speaker soundwaves using frequencies 697 and 1209
peer.multiaddrs.add('/sonic/bfsk/697/1209')
const PeerInfo = require('peer-info')
PeerInfo.create([id])
id
optional - can be a PeerId or a JSON object(will be parsed with https://github.com/libp2p/js-peer-id#createfromjsonobj)Creates a new PeerInfo instance and if no id
is passed it
generates a new underlying PeerID
for it.
Returns Promise<PeerInfo>
.
new PeerInfo(id)
id: PeerId
- instance of PeerId (optional)Creates a new PeerInfo instance from an existing PeerId.
protocols
A list of protocols that peer
supports.
.protocols.add(protocol)
Adds a protocol that peer
can support. protocol
is a string.
.protocols.delete(protocol)
Removes a protocol that peer
no longer supports. protocol
is a string.
multiaddrs
A list of multiaddresses instances that peer
can be reached at.
.multiaddrs.add(addr)
addr: Multiaddr
Adds a new multiaddress that peer
can be reached at. addr
is an instance of
a multiaddr.
.multiaddrs.addSafe(addr)
addr: Multiaddr
The addSafe
call, in comparison to add
, will only add the multiaddr to
multiaddrs
if the same multiaddr tries to be added twice.
This is a simple mechanism to prevent multiaddrs
from becoming bloated with
unusable addresses, which happens when we exchange observed multiaddrs with
peers which will not provide a useful multiaddr to be shared to the rest of the
network (e.g. a multiaddr referring to a peer inside a LAN being shared to the
outside world).
.multiaddrs.delete(addr)
addr: Multiaddr
Removes a multiaddress instance addr
from peer
.
.multiaddrs.replace(existing, fresh)
existing: Multiaddr
fresh: Multiaddr
Removes the array of multiaddresses existing
from peer
, and adds the array
of multiaddresses fresh
.
PRs accepted.
Small note: If editing the Readme, please conform to the standard-readme specification.
FAQs
Unknown package
We found that peer-info demonstrated a not healthy version release cadence and project activity because the last version was released 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 researchers unpack a typosquatting package with malicious code that logs keystrokes and exfiltrates sensitive data to a remote server.
Security News
The JavaScript community has launched the e18e initiative to improve ecosystem performance by cleaning up dependency trees, speeding up critical parts of the ecosystem, and documenting lighter alternatives to established tools.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.