Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ul

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ul

A minimalist utility library.

  • 4.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
52K
decreased by-39.81%
Maintainers
1
Weekly downloads
 
Created
Source

ul Donate now

A minimalist utility library.

Installation

$ npm i ul

Example

// Dependencies
var Ul = require("ul");

// Input data
var obj = {
        n: null
      , v: 1
    }
  , def = {
        n: 1
      , v: 10
      , a: 20
    }
  , tmp = null
  ;

// Merge the two objects and store the result in tmp
console.log(tmp = Ul.merge(obj, def));
// => { n: null, v: 1, a: 20 }

// Clone the tmp object -- the clone will have a
// different reference
console.log(tmp === Ul.clone(tmp));
// => false

// Show the absolute path to the home directory
console.log(Ul.home()); // or `console.log(Ul.HOME_DIR);`
// => /home/ionicabizau

Documentation

merge()

Recursively merge the objects from arguments, returning a new object.

Usage: Ul.merge(obj1, obj2, obj3, obj4, ..., objN)

Return
  • Object The merged objects.

clone(item)

Deep clone of the provided item.

Params
  • Anything item: The item that should be cloned
Return
  • Anything The cloned object

home()

Get the home directory path on any platform. The value can be accessed using Ul.HOME_DIR too.

Return
  • String The home directory path.

How to contribute

Have an idea? Found a bug? See how to contribute.

License

KINDLY © Ionică Bizău–The LICENSE file contains a copy of the license.

Keywords

FAQs

Package last updated on 10 Jun 2015

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