New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@flowblade/core

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@flowblade/core

Core contracts, interfaces and utilities

latest
Source
npmnpm
Version
0.2.26
Version published
Maintainers
1
Created
Source

@flowblade/core

Internal contracts and utilities for flowblade adapters. You generally don't have to install this package separately.

Install

yarn add @flowblade/core

Usage

QResult

This is specialized Result object for database interactions

Create a success QResult

const successResult = new QResult({
  data: [{ name: "Seb" }],
  meta: new QMeta({
    spans: {
      type: "sql",
      timeMs: 13,
      sql: "SELECT name FROM users",
      affectedRows: 1,
      params: [],
    },
  }),
});

// 👇 You can dereference, data, meta and error
const { data, meta, error } = result;
if (data) {
  // typed in this case to { name: string}[]
  console.log(data); // [{ name: 'Seb' }]
}

if (error) {
  // typed in this case to QError
  console.error(error); // QError object
}

Create a failure QResult

const failureResult = new QResult<SuccessPayload, QError>({
  error: {
    message: "Error message",
  },
});

failureResult.isError(); // 👈 true
failureResult.error; // 👈 QError
failureResult.data; // 👈 undefined

Helpers

result.map((row) => {
  return { ...row, name: row.name.toUpperCase() };
});

result.getOrThrow(); // 👈 throw Error('Error message')
// 👇 Customize the error and throws
result.getOrThrow((qErr) => {
  return new HttpServiceUnavailable({
    cause: new Error(qErr.message),
  });
});

Bundle size

Bundle size is tracked by a size-limit configuration

Scenario (esm)Size (compressed)
import * from '@flowblade/core~ 2.04kB
import { QResult } from '@flowblade/core~ 1.63kB

Compatibility

LevelCIDescription
NodeCI for v20.x -> v25.x.
BrowserTested with latest chrome (vitest/playwright)
Browserslist> 95% on 01/2025. Chrome 96+, Firefox 90+, Edge 19+, ios 15+, Safari 15+ and Opera 77+
EdgeEnsured on CI with @vercel/edge-runtime.
CloudflareEnsured with @cloudflare/vitest-pool-workers (see wrangler.toml
TypescriptTS 5.0 + / are-the-type-wrong checks on CI.
ES2022Dist files checked with es-check
PerformanceMonitored with codspeed.io

Contributors

Contributions are welcome. Have a look to the CONTRIBUTING document.

Sponsors

Sponsor, coffee, or star – All is spent for quality time with loved ones. Thanks ! 🙏❤️

Special thanks to

Jetbrains logo
JetBrains

License

MIT © Sébastien Vanvelthem and contributors.

FAQs

Package last updated on 11 Mar 2026

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