New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@alanscodelog/utils

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@alanscodelog/utils

My utility functions and typescript types.

  • 4.0.0-beta.9
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-89.74%
Maintainers
1
Weekly downloads
 
Created
Source

Docs Build Release

A collection of my utility functions and types. Mostly intended for use within my own projects.

Docs

Install

npm install @alanscodelog/utils
# or
yarn add @alanscodelog/utils

Usage

There's four types of utility functions available, with some having node only variants:

  • utils - the main utility functions
    • node_utils - node only utility functions
  • testing - functions that are only useful for testing purposes
  • retypes - existing functions typed as something else (e.g. Object.keys cast to a type that's useful for iterating, etc)
  • types - all the types used internally + any utility types
    • Also includes any enums. And there's also:
  • colors - contains the basic ansi escape codes, for small scripts, or debugging, where I don't need to add chalk.

Some utility functions are browser only, but they are included with the regular functions since they'll just throw when you try to use them (they should not cause errors when just getting imported). The node only ones will though so they must be separated.

// everything can be imported directly from the package (except individual colors and node_* only imports)
import { keys, debounce, colors, ...} from "@alanscodelog/utils"

// or you can import them like this to be clearer
import { MakeOptional, ...} from "@alanscodelog/utils/types"
// direct imports are also supported
import {debounce} from "@alanscodelog/utils/utils/debounce.js"

Vite seems to properly treeshake the 99.9%* of the root imports, but it might be a problem with other bundlers, in which case import from one of the export paths.

* There is one small namespace (Result) that it does not seem to be able to treeshake, but this is regardless of where you import it from, unless you use direct imports everywhere.

FAQs

Package last updated on 20 Jul 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc