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

@forgedevstack/anvil

v1.0.1

Published

A modern utility library with React hooks and Vue composables - the forge where code is shaped

Readme

⚒️ Anvil


✨ Features

  • 🔧 100+ Utility Functions - Deep clone, type guards, array/object manipulation, string utilities
  • ⚛️ React Hooks - useResponsive, useForm, useDebounce, useThrottle, and many more
  • 💚 Vue Composables - First-class Vue 3 support with reactivity
  • 🎯 TypeScript First - Full type safety with comprehensive type utilities
  • 📦 Tree-shakeable - Import only what you need
  • 🚀 Zero Dependencies - Lightweight and fast
  • 🌐 Framework Agnostic - Works with React, Vue, Angular, Node.js, and vanilla JS

📦 Installation

npm install @forgedevstack/anvil
yarn add @forgedevstack/anvil
pnpm add @forgedevstack/anvil

🚀 Quick Start

Utility Functions

import {
  deepClone,
  isNullOrUndefined,
  debounce,
  throttle,
  camelCase,
  unique,
  groupBy,
} from '@forgedevstack/anvil';

const cloned = deepClone({ nested: { data: [1, 2, 3] } });

const debouncedSearch = debounce((query: string) => {
  console.log('Searching:', query);
}, 300);

const uniqueItems = unique([1, 2, 2, 3, 3, 3]);

const grouped = groupBy(users, 'role');

React Hooks

import {
  useResponsive,
  useDebounce,
  useForm,
  useLocalStorage,
  useToggle,
} from '@forgedevstack/anvil';

function MyComponent() {
  const { isMobile, isDesktop, breakpoint } = useResponsive();

  const [theme, setTheme] = useLocalStorage('theme', 'dark');

  const [isOpen, toggle] = useToggle(false);

  const { values, setValue, handleSubmit, errors } = useForm({
    email: '',
    password: '',
  });

  const { call: debouncedSearch } = useDebounce(
    (query: string) => fetchResults(query),
    { delay: 300 }
  );

  return (
    <div>
      {isMobile ? <MobileView /> : <DesktopView />}
    </div>
  );
}

Vue Composables

<script setup lang="ts">
import { useResponsive, useDebounce, useToggle } from '@forgedevstack/anvil/hooks/vue';

const { isMobile, isDesktop } = useResponsive();
const { value: isOpen, toggle } = useToggle(false);

const searchQuery = ref('');
const debouncedQuery = useDebounce(searchQuery, 300);
</script>

📚 API Reference

Type Guards

isUndefined(value)
isNull(value)
isNullOrUndefined(value)
isDefined(value)
isString(value)
isNumber(value)
isBoolean(value)
isArray(value)
isPlainObject(value)
isFunction(value)
isDate(value)
isEmpty(value)
isPrimitive(value)

Clone Utilities

deepClone(value)
shallowClone(value)
deepFreeze(object)
deepSeal(object)

Array Utilities

first(arr)
last(arr)
take(arr, n)
drop(arr, n)
unique(arr, key?)
chunk(arr, size)
groupBy(arr, key)
flatten(arr, depth?)
intersection(arr1, arr2)
difference(arr1, arr2)
union(arr1, arr2)
shuffle(arr)
sample(arr, count?)
partition(arr, predicate)

Object Utilities

get(obj, path, defaultValue?)
set(obj, path, value)
has(obj, path)
pick(obj, keys)
omit(obj, keys)
merge(...objects)
deepMerge(...objects)
mapValues(obj, mapper)
flattenObject(obj, separator?)
isEqual(obj1, obj2)

String Utilities

capitalize(str)
camelCase(str)
pascalCase(str)
snakeCase(str)
kebabCase(str)
slugify(str)
truncate(str, length, suffix?)
escapeHtml(str)
uuid()

Function Utilities

debounce(fn, delay, options?)
throttle(fn, interval, options?)
memoize(fn, keyResolver?)
once(fn)
curry(fn)
compose(...fns)
pipe(...fns)
retry(fn, retries?, delay?)

React Hooks

useDebounce(callback, options)
useDebounceValue(value, delay)
useThrottle(callback, options)
useResponsive(breakpoints?)
useMediaQuery(query)
useForm(initialValues, rules?)
useLocalStorage(key, initialValue)
useSessionStorage(key, initialValue)
useToggle(initialValue?)
useBoolean(initialValue?)
usePrevious(value)
useClickOutside(handler, options?)
useEscapeKey(handler)
useFetch(url, options?)
useAsync(asyncFn, options?)
useInterval(callback, delay, options?)
useTimeout(callback, delay)
useCountdown(seconds, onComplete?)
useMounted()
useForceUpdate()

Vue Composables

useDebounce(value, delay)
useThrottle(value, interval)
useResponsive(breakpoints?)
useMediaQuery(query)
useLocalStorage(key, initialValue)
useToggle(initialValue?)
useClickOutside(handler)
useInterval(callback, delay)
useWindowSize()
usePrevious(value)
useMounted()
useAsync(asyncFn)
useCountdown(seconds)
useEscapeKey(handler)

Types

type DeepPartial<T>
type DeepRequired<T>
type DeepReadonly<T>
type Mutable<T>
type KeysOfType<T, V>
type PickByType<T, V>
type OmitByType<T, V>
type UnionToIntersection<U>
type MaybePromise<T>
type MaybeArray<T>
type Path<T>
type PathValue<T, P>

🎨 Philosophy

Anvil is designed with the following principles:

  1. Simplicity - Clear, readable APIs that do one thing well
  2. Type Safety - Comprehensive TypeScript support throughout
  3. Performance - Optimized implementations with minimal overhead
  4. Flexibility - Works with any framework or vanilla JavaScript
  5. Consistency - Unified API design across utilities and hooks

📄 License

MIT © John Yaghobieh