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

@data-loom/js

v0.4.13

Published

Isomorphic Javascript client for dataloom

Readme

Usage

Install

npm install @data-loom/js

Initializing

import { createClient } from '@data-loom/js'

// Create a single dataloom client for interacting with your database
const dataloom = createClient(url, key, workspace, {
  global: {
    brandName: 'abc', // assigned by dataloom
    appId: 'app_xyz', // application id created by consumer
  },
});

Fetch data

Perform a SELECT query on the table or view.

const { data, error } = await dataloom
  .from('characters')
  .select()

参数

| 参数名称 | 必需 | 类型 | 描述 | | -------- | ----| ------ | ---- | | columns | Optional | Query | The columns to retrieve, separated by commas. Columns can be renamed when returned with customName:columnName | | options | Required | object | Named parameters |

options 对象

| 参数名称 | 必需 | 类型 | 描述 | | --------------- | ---- | ------ | ---- | | count | Optional | exact planned estimated | Count algorithm to use to count rows in the table or view. | | head | Optional | boolean | When set to true, data will not be returned. Useful if you only need the count. |

Insert data

Perform an INSERT into the table or view.

const { error } = await dataloom
  .from('countries')
  .insert({ id: 1, name: 'Mordor' })

参数

| 参数名称 | 必需 | 类型 | 描述 | | -------- | ----| ------ | ---- | | values | Required | Row Array<Row> | The values to insert. Pass an object to insert a single row or an array to insert multiple rows. | | options | Optional | object | Named parameters |

options 对象

| 参数名称 | 必需 | 类型 | 描述 | | --------------- | ---- | ------ | ---- | | count | Optional | exact planned estimated | Count algorithm to use to count inserted rows. | | defaultToNull | Optional | boolean | Make missing fields default to null. Otherwise, use the default value for the column. Only applies for bulk inserts. |

Update data

Perform an UPDATE on the table or view.

const { error } = await dataloom
  .from('instruments')
  .update({ name: 'piano' })
  .eq('id', 1)

参数

| 参数名称 | 必需 | 类型 | 描述 | | -------- | ----| ------ | ---- | | values | Required | Row | The values to update with | | options | Required | object | Named parameters |

options 对象

| 参数名称 | 必需 | 类型 | 描述 | | --------------- | ---- | ------ | ---- | | count | Optional | exact planned estimated | Count algorithm to use to count updated rows. |

Delete data

Perform a DELETE on the table or view.

const response = await dataloom
  .from('countries')
  .delete()
  .eq('id', 1)

参数

| 参数名称 | 必需 | 类型 | 描述 | | -------- | ----| ------ | ---- | | options | Required | object | Named parameters |

options 对象

| 参数名称 | 必需 | 类型 | 描述 | | --------------- | ---- | ------ | ---- | | count | Optional | exact planned estimated | Count algorithm to use to count updated rows. |

Using filters

Filters allow you to only return rows that match certain conditions.
Filters can be used on select(), update(), upsert(), and delete() queries.

  • Column is equal to a value
const { data, error } = await dataloom
  .from('characters')
  .select()
  .eq('name', 'Leia')
  • Column is not equal to a value
const { data, error } = await dataloom
  .from('characters')
  .select()
  .neq('name', 'Leia')
  • Column is greater than a value
const { data, error } = await dataloom
  .from('characters')
  .select()
  .gt('id', 2)
  • Column is greater than or equal to a value
const { data, error } = await dataloom
  .from('characters')
  .select()
  .gte('id', 2)
  • Column is less than a value
const { data, error } = await dataloom
  .from('characters')
  .select()
  .lt('id', 2)
  • Column is less than or equal to a value
const { data, error } = await dataloom
  .from('characters')
  .select()
  .lte('id', 2)
  • Column matches a pattern
const { data, error } = await dataloom
  .from('characters')
  .select()
  .like('name', '%Lu%')
  • Column matches a case-insensitive pattern
const { data, error } = await dataloom
  .from('characters')
  .select()
  .ilike('name', '%lu%')
  • Column is a value
const { data, error } = await dataloom
  .from('countries')
  .select()
  .is('name', null)
  • Column is in an array
const { data, error } = await dataloom
  .from('characters')
  .select()
  .in('name', ['Leia', 'Han'])
  • Match an associated value
const { data, error } = await dataloom
  .from('characters')
  .select('name')
  .match({ id: 2, name: 'Leia' })
  • Don't match the filter
const { data, error } = await dataloom
  .from('countries')
  .select()
  .not('name', 'is', null)
  • Don't match the filter
const { data, error } = await dataloom
  .from('characters')
  .select('name')
  .or('id.eq.2,name.eq.Han')
  • Match the filter
const { data, error } = await dataloom
  .from('characters')
  .select()
  .filter('name', 'in', '("Han","Yoda")')

Using modifiers

Filters work on the row level—they allow you to return rows that only match certain conditions without changing the shape of the rows. Modifiers are everything that don't fit that definition—allowing you to change the format of the response (e.g., returning a CSV string).
Modifiers must be specified after filters. Some modifiers only apply for queries that return rows

  • Order the results
const { data, error } = await dataloom
  .from('characters')
  .select('id, name')
  .order('id', { ascending: false })
  • Limit the number of rows returned
const { data, error } = await dataloom
  .from('characters')
  .select('name')
  .limit(1)
  • Limit the query to a range
const { data, error } = await dataloom
  .from('countries')
  .select('name')
  .range(0, 1)
  • Retrieve one row of data
const { data, error } = await dataloom
  .from('characters')
  .select('name')
  .limit(1)
  .single()
  • Retrieve zero or one row of data
const { data, error } = await dataloom
  .from('characters')
  .select()
  .eq('name', 'Katniss')
  .maybeSingle()

Acknowledgements

This project references the implementation of @supabase/supabase-js.

@supabase/supabase-js is licensed under the MIT License.