
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
panic-client
Advanced tools
Lightweight client for panic-server
Since this library is just support for panic-server, you can find the majority of the documentation over there.
Panic-client is hosted on npm, and can be installed by running this in your terminal:
npm install panic-client
If you're not familiar with npm, you can learn more by clicking here, or you can install it by following these instructions.
Panic-client's API surface area is pretty small, since it's just a small wrapper around socket.io. It consists of one method, server
, and two properties, connection
and platform
.
There are two ways to include it in your code, depending on your environment...
Node.js
// simply import it.
var panic = require('panic-client')
Browser
If you're using panic-server, the server automatically delivers the browser file at the at the port/hostname you configured. By default, it will be 'http://localhost:8080/panic.js'.
If you're not using panic-server, it may be more complicated, depending on your file structure. If you're using webpack, simply include it the same way as you would on Node.js. Otherwise, the browser build is located at root level, named panic.js
. Simply point a script tag there, or copy it into your project root...
<script src="node_modules/{path to panic-client}/panic.js"></script>
<script>
panic; // now exposed as a global variable
</script>
Best practice is to load through panic-server.
<script src="http://localhost:8080/panic.js"></script>
.server(String)
This method attempts to connect to your panic-server host, and allows panic-server to run code on your machine in real-time. Just give it the url.
// This is the default url.
// When connecting from another computer,
// exchange `localhost` with your ip address.
panic.server('http://localhost:8080')
.connection
panic.connection
is the websocket opened to panic-server. If you haven't called panic.server()
yet, it'll be null
.
.platform
The panic.platform
object is created by platform.js, and contains information about what environment the code is running on.
If you have questions or ideas, please let us know on our gitter channel :grinning:
v0.1.2
FAQs
Test client for panic-server
The npm package panic-client receives a total of 3 weekly downloads. As such, panic-client popularity was classified as not popular.
We found that panic-client 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.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.