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 🙏

© 2024 – Pkg Stats / Ryan Hefner

devbee

v0.0.3

Published

> Simplify generated code and automated tasks.

Downloads

2

Readme

:honeybee: DevBee ::honeybee:

Simplify generated code and automated tasks.

What is DevBee?

DevBee is a powerful devtool designed to streamline your development workflow. Imagine having a team of worker bees that handle repetitive tasks for you! With DevBee, you can run custom functions whenever a file changes, automating processes like adding copyright headers, autogenerating types, and more. The possibilities are endless. Plus, DevBee supports plugins, allowing you to share your bees with fellow developers

Getting Started

Installation

Install DevBee using your preferred package manager:

npm install devbee      # npm
yarn add devbee         # yarn
bun add devbee          # bun
pnpm add devbee         # pnpm

Configuration

Create a devbee.config.ts file in your project’s root directory. Add the following content:

import type { DevBeeConfig } from "devbee";

import fs from "fs/promises";

const COPYRIGHT_HEADER = `/**
* Copyright (c) Test
*/`;

const config: DevBeeConfig = {
  plugins: [
    // Add your plugins here
  ],
  bees: [
    // Define your bees (tasks to run on file change)
    {
      paths: "./**/*.ts",
      name: "Add Copyright Header",
      // Function that runs on each file change
      buzz: async ({ contents, path }) => {
        if (contents.startsWith(`/**`)) return;
        await fs.writeFile(path, `${COPYRIGHT_HEADER}\n${contents}`, "utf-8");
      },
    },
  ],
};

export default config;

Thats it!

:tada: You’re all set! DevBee empowers you to automate mundane tasks, leaving you more time to focus on what matters—building great software.

:honey_pot: DevBee API :honey_pot:

type DevBeeConfig = {
  // Explore Plugin Docs for more info
  plugins: DevBeePlugin[];
  // An array of bees (tasks to run on file change)
  bees: Bee[];
};
// Think of a bee as something you create once; it performs the same task repeatedly whenever a file changes.

type Bee = {
  // Paths to watch for changes (can be a glob pattern)
  paths: string | string[];
  // Name of the plugin
  name: string;
  // Async function that runs on each file change
  buzz: (params: { contents: string; path: string }) => Promise<void>;
};
  • paths (string or array of strings). Paths to files, dirs to be watched recursively, or glob patterns.
    • globs must not contain windows separators (\). You'll need to replace them with forward slashes (/).
    • for additional glob documentation, check out picomatch's documentation.

buzz Arguments

contents: The contents of the file that was changed. path: The path of the file that was changed.