Security News
NIST Misses 2024 Deadline to Clear NVD Backlog
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
@pkmn/client
Advanced tools
@pkmn/client
Package encapsulating a refactored version of the generic parts of the official Pokémon Showdown's client's engine.
$ npm install @pkmn/client
Note that either @pkmn/dex
or @pkmn/sim
must also be installed to provide
a Dex
implementation.
@pkmn/client
manintains a battle's state based on information contained in the Pokémon Showdown
protocol. A
Battle
can be instantiated with a Dex
implementation and used to track the
state of a battle by add
-ing protocol messages off the wire. The Battle
can then be queried
to determine information about the sides / field / Pokemon involved and their current status. The
state information that can be obtained from the protocol goes beyond the information provided in
the |request|
messages sent from the server and together both provide a more complete view of the
true state of the battle.
import {Battle} from '@pkmn/client';
import {Dex} from '@pkmn/dex';
const battle = new Battle(Dex);
for (const line of lines) {
battle.add(line);
... // manipulate battle
}
The UI integration test serves as an example for how the
@pkmn/client
library can be used to display the results of a battle visually. Note how it makes
use of multiple Handler
's ordered carefully to account for when the Battle
state was
updated. @pkmn/view
's LogFormatter
is an example of
a Handler
which depends on being run before the client's Handler
(and has been designed to
work hand-in-hand with Battle
).
The recommended way of using @pkmn/client
in a web browser is to configure your bundler
(Webpack, Rollup,
Parcel, etc) to minimize it and package it with the rest of your
application.
This package is distributed under the terms of the MIT License. Substantial amounts of the code have been derived from the portions of the Pokémon Showdown client which are distributed under the MIT License.
FAQs
Client battle engine for Pokémon Showdown
The npm package @pkmn/client receives a total of 16 weekly downloads. As such, @pkmn/client popularity was classified as not popular.
We found that @pkmn/client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.