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

sanity-bulk-data-operations

v1.0.0

Published

Flexible bulk data operations utility for Sanity Studio - search, add, and modify data across any document types with safety features

Readme

Sanity Bulk Data Operations

A flexible bulk data operations utility for Sanity Studio that enables searching, adding, and modifying data across any document types with comprehensive safety features and batch processing.

Features

  • 🔍 Flexible Search: Search across any document type with multiple criteria
  • ✏️ Bulk Modifications: Update multiple documents simultaneously
  • Batch Creation: Create multiple documents with templates
  • 🎯 Custom GROQ Queries: Advanced users can write custom queries
  • 🛡️ Safety First: Confirmation dialogs, dry-run mode, and validation
  • 📊 Progress Tracking: Real-time feedback during operations
  • 🔄 Batch Processing: Handles large datasets efficiently
  • 📱 Responsive UI: Seamless integration with Sanity Studio

Installation

npm install sanity-bulk-data-operations

Quick Start

Basic Usage

import React from 'react'
import { BulkDataOperations } from 'sanity-bulk-data-operations'
import { useClient } from 'sanity'

const BulkOperations = () => {
  const client = useClient({ apiVersion: '2023-01-01' })

  return (
    <BulkDataOperations
      client={client}
      onComplete={(results) => {
        console.log(`Operation complete: ${results.processed} documents`)
      }}
    />
  )
}

As a Sanity Studio Tool

// sanity.config.ts
import { defineConfig } from 'sanity'
import { BulkDataOperationsTool } from 'sanity-bulk-data-operations'

export default defineConfig({
  // ... other config
  tools: [
    BulkDataOperationsTool()
  ]
})

Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | client | SanityClient | required | Sanity client instance | | documentTypes | string[] | [] | Specific document types to work with | | onComplete | function | undefined | Callback when operation completes | | onError | function | undefined | Error handling callback | | batchSize | number | 10 | Number of documents to process per batch | | dryRun | boolean | false | Preview mode without actual changes | | maxDocuments | number | 1000 | Maximum documents to process |

Operations

1. Bulk Search and Filter

Search across any document types with flexible criteria:

// Component provides UI for:
// - Document type selection
// - Field-based search
// - Date range filtering
// - Custom GROQ queries

2. Bulk Modifications

Update multiple documents simultaneously:

// Examples of bulk operations:
// - Update all posts to published status
// - Add tags to multiple documents
// - Update author references
// - Modify field values across documents

3. Batch Creation

Create multiple documents from templates:

// Use cases:
// - Create multiple pages from template
// - Generate test data
// - Import structured data
// - Duplicate existing documents

Safety Features

Dry Run Mode

<BulkDataOperations client={client} dryRun={true} />
  • Preview changes without applying them
  • Test operations safely
  • Validate batch sizes and queries

Confirmation Dialogs

  • All operations require explicit confirmation
  • Clear warnings for destructive actions
  • Detailed summary before execution

Batch Processing

  • Large operations processed in configurable batches
  • Progress feedback during long operations
  • Prevents timeout issues

Requirements

  • Sanity Studio v3+
  • React 18+
  • @sanity/ui v1+
  • TypeScript 4.5+ (optional)

License

MIT License - see LICENSE file for details.

Contributing

Contributions are welcome! Please read our contributing guidelines and submit pull requests to help improve this utility.