npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@global-torque/invest-core

v0.4.0

Published

Pure investment policy, calculations, formatters, and schema helpers.

Downloads

11,475

Readme

@global-torque/invest-core

Pure investment-domain logic shared by apps and packages.

Ownership

This package owns deterministic helpers, mappers, formatters, calculations, and normalization utilities that do not need Vue, Pinia, router, browser app state, repositories, network clients, or runtime config singletons.

Allowed Dependencies

  • @global-torque/domain-types.
  • AJV, ajv-errors, ajv-formats, lodash, and markdown-it for the published investment validation and formatting helpers.
  • TypeScript and platform-standard value types.

Forbidden Dependencies

  • Vue, Pinia, Vue Router, or app packages.
  • The retired common compatibility layer, @global-torque/ui-kit, or @global-torque/ui-primitives.
  • Network clients, repositories, stores, route views, import.meta.env, or runtime singleton config.

Public Exports

app/config, markdown/tableWrap, and helpers/text retain their source TypeScript browser and type targets and additionally provide exact generated dist/node JavaScript for plain Node/VitePress configuration consumers. The candidate packer emits only these three Node files; all other exports remain source based.

  • analytics/analyticsBody: analytics request body normalization with exact credential-field redaction. User, business, numeric, URL, and diagnostic values are retained unless assigned to a known credential field.
  • decimal/canonicalDecimal: numeric(38,18) canonical-string validation, exact scaled-integer arithmetic, comparison, and display formatting.
  • evm/walletInfo: EVM wallet status-only response normalization and deposit-address extraction.
  • filer/publicImage: pure public filer image URL and srcset builders with injected filerUrl.
  • formatting/dateTime: shared en-US date and local time formatting helpers.
  • formatting/display: USD currency formatting and first-letter capitalization.
  • investment/status: investment status and funding clickability helpers.
  • investment/rawAmount: exact raw-token decimal conversion, comparison, and presentation helpers that never use floating-point arithmetic.
  • kyc/status, kyc/kycAlert, kyc/thirdPartyScreen: KYC status compatibility re-export from domain-types plus normalized view models.
  • offer/metrics: offer funding percent, minimum investment, Reg D 506(c), recency, and funding-completion calculations.
  • profiles/formatting: profile date and phone display formatters.
  • repository/formatterCache: generic formatter memoization helper.
  • wallet/auth, wallet/setupError: wallet-auth normalization and setup-required error classification.
  • wallet/operationPresentation: wallet operation text shortening, asset/address labels, and injected explorer-link builders.
  • form-validation: investment-only AJV policy, validation rule descriptors, immutable schema composition, empty-string normalization, and pure schema projection helpers. createInvestmentAjv() creates one validator per form; legacy file and maxFileSize annotations are accepted as presentation compatibility and do not change backend validation semantics.
  • root export: compatibility barrel for the pure helpers above.

Example

import { buildPublicFilerImageUrl } from '@global-torque/invest-core/filer/publicImage';

const imageUrl = buildPublicFilerImageUrl(42, 'medium', {
  filerUrl: 'https://filer.example.com',
});

Investment forms explicitly opt into policy at the UI boundary:

import {
  composeInvestmentFormSchema,
  createInvestmentAjv,
  prepareInvestmentFormData,
} from '@global-torque/invest-core/form-validation';

const validationOptions = {
  createAjv: createInvestmentAjv,
  composeSchema: composeInvestmentFormSchema,
  prepareData: prepareInvestmentFormData,
};