Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@arcjet/analyze

Package Overview
Dependencies
Maintainers
2
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@arcjet/analyze

Arcjet local analysis engine

  • 1.0.0-alpha.7
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.3K
decreased by-17.99%
Maintainers
2
Weekly downloads
 
Created
Source
Arcjet Logo

@arcjet/analyze

npm badge

Arcjet helps developers protect their apps. Installed as an SDK, it provides a set of core primitives such as rate limiting and bot protection. These can be used independently or combined to create a set of layered defenses, such as signup form protection.

This is the Arcjet local analysis engine.

Installation

npm install -S @arcjet/analyze

Example

import { generateFingerprint, isValidEmail } from "@arcjet/analyze";

const fingerprint = generateFingerprint("127.0.0.1");
console.log("fingerprint: ", fingerprint);

const valid = isValidEmail("hello@example.com");
console.log("is email valid?", valid);

Implementation

This package provides analyze logic implemented as a WebAssembly module which will run local analysis on request details before calling the Arcjet API.

The arcjet.wasm.js file contains the binary inlined as a base64 Data URL with the application/wasm MIME type.

This was chosen to save on storage space over inlining the file directly as a Uint8Array, which would take up ~3x the space of the Wasm file. See Better Binary Batter: Mixing Base64 and Uint8Array for more details.

It is then decoded into an ArrayBuffer to be used directly via WebAssembly's compile() function in our entry point file.

This is all done to avoid trying to read or bundle the Wasm asset in various ways based on the platform or bundler a user is targeting. One example being that Next.js requires special asyncWebAssembly webpack config to load our Wasm file if we don't do this.

In the future, we hope to do away with this workaround when all bundlers properly support consistent asset bundling techniques.

API

In progress.

License

Licensed under the Apache License, Version 2.0.

FAQs

Package last updated on 21 Dec 2023

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc