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

@deep-grasp/build

v0.8.0

Published

Build tools for deep-grasp

Readme

@deep-grasp/build

Command line tool to help integrate with deep-grasp.

Install

npm install -D @deep-grasp/build

When installed, a deep-grasp command is available.

Generate graspable code

Use deep-grasp generate to analyze your project source code and generate graspable code for you.

--cwd #0         specify current working directory, default to process.cwd()
--includes #0    globs included in analyze
--excludes #0    globs excluded from analyze
--format #0      output format, can be "json" or "module", default to "json"
--output #0      output file, use "1" for stdout, by default writes to @deep-grasp/build package

By default, deep-grasp generate scans all your .tsx files inside src directory, detecting all import {graspable} from '@deep-grasp/core statements and graspable() calls, collecting description and props definition of components.

Limitation

You should import graspable function using a named import.

import {graspable} from '@deep-grasp/react';

graspable(/* ... */);

Named import can be aliased, so this is supported (but not recommended):

import {graspable as g} from '@deep-grasp/react';

g(/* ... */);

When invoing graspable() function, you must pass a component type directly to its first argument, this cannot be a call of HoC or other complex expressions, so these are NOT supported:

graspable(memo(MyComponent));

graspable(MyComponent.Label);

Also, once your component has a props parameter, it must be attached a type annotation, this annotation must be a direct type reference, any type helper like Partial, Pick and Omit are not supported, any is also unsuported.

Your component's props type must be easy to analyze, it requires that:

  1. No union and intersection types, except usage of string literal union on fields.
  2. No complex type helpers like Partial, Omit, etc.
  3. No reference to third-party types, we don't scan node_modules.

Specify output format

deep-grasp generate output a JavaScript module code by default, this looks like:

const named = name => module => module[name];

export const components = [
    {
        definition: {
            name: 'auto_generated_function_name',
            description: 'hello world',
            props: {
                type: 'object',
                properties: {message: {type: 'string', description: 'Greeting message to display to users'}},
                required: ['message'],
                additionalProperties: false,
            },
        },
        load: () => import('file_path_to_component').then(named('default')),
    },
];

You can also ask to output a JSON format by using --format=json, generated JSON forms in this way:

{
  "components": [
    {
      "file": "file_path_to_component",
      "exportName": "default",
      "definition": {
        "name": "auto_generated_function_name",
        "description": "hello world",
        "props": {
          "type": "object",
          "properties": {
            "message": {
              "type": "string",
              "description": "Greeting message to display to users"
            }
          },
          "required": [
            "message"
          ],
          "additionalProperties": false
        }
      }
    }
  ]
}

Output to file

To keep it simple, deep-grasp generate will find @deep-grasp/core package based on your project, you must have it installed.

Generated code is by default written to @deep-grasp/core/dist/generated.{ts|json}, you can reference them by import {components} from '@deep-grasp/core'.

You can also specify the output file using --output=path/to/file, this will overwrite the default generated code, we don't validate the file extension so keep in mind to use .json when --format=json.