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

@biomejs/js-api

Package Overview
Dependencies
Maintainers
5
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@biomejs/js-api

JavaScript APIs for the Biome package

  • 0.6.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
5
Created
Source

Biome JavaScript Bindings

Official JavaScript bindings for Biome

Warning: The API is currently in alpha. It is not yet ready for production use. We appreciate your support and feedback as we work to make it ready for everyone.

Installation

npm i @biomejs/js-api
npm i @biomejs/wasm-<dist>

You need to install one of the @biomejs/wasm-* package as a peer dependency for this package to work correctly, out of the following distributions:

  • @biomejs/wasm-bundler: Install this package if you're using a bundler that supports importing *.wasm files directly
  • @biomejs/wasm-nodejs: Install this package if you're using Node.js to load the WebAssembly bundle use the fs API
  • @biomejs/wasm-web: Install this package if you are targeting the web platform to load the WASM bundle using the fetch API

Usage

import { Biome, Distribution } from "@biomejs/js-api";

const biome = await Biome.create({
	distribution: Distribution.NODE, // Or BUNDLER / WEB depending on the distribution package you've installed
});

const formatted = biome.formatContent("function f   (a, b) { return a == b; }", {
	filePath: "example.js",
});

console.log('Formatted content: ', formatted.content);

const result = biome.lintContent(formatted.content, {
	filePath: "example.js",
});

const html = biome.printDiagnostics(result.diagnostics, {
	filePath: "example.js",
	fileSource: formatted.content,
});

console.log('Lint diagnostics: ', html);

Philosophy

The project philosophy can be found on our website.

Community

Contribution and development instructions can be found in CONTRIBUTING.

Additional project coordination and real-time discussion happens on our Discord server. Remember that all activity on the Discord server is still moderated and will be strictly enforced under the project's Code of Conduct.

Keywords

FAQs

Package last updated on 06 May 2024

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