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

util-ex

Package Overview
Dependencies
Maintainers
1
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

util-ex

Browser-friendly enhanced util fully compatible with standard node.js

  • 0.3.5
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

util-ex Build Status npm downloads license

Browser-friendly enhanced util fully compatible with standard node.js util

This package modifies and enhances the standard util from node.js

API

definePropery

definePropery(object, key, value[, aOptions])

Define a porperty on the object.

usage

definePropery = require 'util-ex/lib/definePropery'

propValue = ''
definePropery this, 'prop', 'simpleValue'
definePropery this, 'prop', undefined,
  get: -> propValue
  set: (value) -> propValue = value

newFunction

newFunction(name, arguments, body[, scope[, values]])
newFunction(functionString[, scope[, values]])

create a function via sring.

newFunction = require('util-ex/lib/new-function')

var fn = newFunction('yourFuncName', ['arg1', 'arg2'], 'return log(arg1+arg2);', {log:console.log})
newFunction('function yourFuncName(){}')
newFunction('function yourFuncName(arg1, arg2){return log(arg1+arg2);}', {log:console.log})
newFunction('function yourFuncName(arg1, arg2){return log(arg1+arg2);}', ['log'], [console.log])

//fn.toString() is :
 "function yourFuncName(arg1, arg2) {
    return log(arg1+arg2);
 }"

Keywords

FAQs

Package last updated on 12 Jul 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