New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

dakini

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dakini

utils for node.js

latest
npmnpm
Version
1.0.7
Version published
Weekly downloads
8
300%
Maintainers
1
Weekly downloads
 
Created
Source

Dakini

Utility functions for Node.js (≥22) - random numbers, file system helpers, time formatting, and cross-platform directory paths.

Installation

npm install dakini

API

Random & Probability

  • random(n, isFloating) - Random number [0, n)
  • range(min, max, isFloating) - Random number [min, max)
  • flipCoin() - Random boolean (50/50)
  • chance(chance, range) - Random boolean with probability
  • shuffle(arr) - Shuffle array in place

Math

  • factorial(num) - Calculate factorial

Time

  • formatTimeRange(seconds) - Format time range as {days, hours, minutes, seconds}

File System

  • ensureDir(dir) - Create directory recursively
  • readFromFile(file) - Read file contents

System

  • getUsername() - Get current username
  • getConfigDir(app) - Get app config directory (XDG-compliant)
  • getDataDir(app) - Get app data directory
  • getStateDir(app) - Get app state directory
  • getCacheDir(app) - Get app cache directory

Utilities

  • sleep(milliseconds) - Async delay
  • getCounter() - Returns incrementing counter function

License

GNU

FAQs

Package last updated on 30 Dec 2025

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