Skip to main content

@barocss/shared

Version in this checkout: 1.0.1. npm · Source

Shared selection, units, keyboard, document-file, local-storage, and lifecycle utilities.

Purpose

Use the focused helper needed by your integration rather than duplicating editor conventions.

Install

npm install @barocss/shared

The published package provides ES modules and TypeScript declarations. Use a bundler that supports package exports.

Public entry points

ImportRole
@barocss/sharedPublic JavaScript and TypeScript API

Import only these public paths. Source paths such as @barocss/shared/src/... are not part of the published API.

Usage

import { pxToTwip, twipToPx, formatCounter } from '@barocss/shared';

const modelWidth = pxToTwip(96);
console.log(twipToPx(modelWidth)); // 96
console.log(formatCounter(3, 'decimal'));

Integration notes

Some helpers are pure and others require browser storage or DOM APIs. Document-library helpers provide local storage, not cloud synchronization. Keep runtime node identities separate from durable file identities.

Documentation

License

MIT. The published archive includes the license in dist/LICENSE.