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.

  • 3.2.0
  • 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:

  • utils - the main utility functions
    • Within these, some are node/browser only, they are tagged accordingly (@env node/@env browser).
  • 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 And there's also:
  • colors - contains the basic ansi escape codes, for small scripts, or debugging, where I don't need to add chalk.
// everything can be imported directly from the package (except individual colors)
import { keys, debounce, ... } from "@alanscodelog/utils"

You can also import an entire set, although this is not recommended because it makes it so the imports can't be treeshaken. Still it's possible because it's occasionally useful for prototyping.

import {utils, testing, retypes, types} from "@alanscodelog/utils"

Usually though, for better clarity, I import directly from the folders in the dist folder. The path becomes kind of long though so I set an alias to it (@utils) in my babel/typescript configs.

import { keys } from "@alanscodelog/utils/dist/retypes"
// @alanscodelog/utils/dist aliased to @utils:
import { keys } from "@utils/retypes"

FAQs

Package last updated on 20 May 2022

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