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

jengine-fn

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jengine-fn

Basic JS Web Tools

latest
Source
npmnpm
Version
0.1.60
Version published
Maintainers
1
Created
Source

jEngine: fn wercker status

npm version Bower version Build Status

MIT License

global function 'fn' to sandbox all other definitions

Old Browsers

it's recomended to add this code before scripts to ensure compatibility with old browsers

<!--[if lt IE 9]>
    <script src="//cdnjs.cloudflare.com/ajax/libs/es5-shim/4.0.5/es5-shim.min.js"></script>
<![endif]-->
<!--[if lt IE 12]>
    <script src="//cdnjs.cloudflare.com/ajax/libs/es6-shim/0.21.1/es6-shim.min.js"></script>
<![endif]-->

Installation

npm install jengine-fn --save

or

bower install jengine-fn --save

Usage

fn.define(moduleName, dependencies?, definition)

fn.define('moduleName', [ 'dependence_1', 'dependence_2', ..., function ( dependence_1, dependence_1, ...) {

	// your code

	return definition;
} ]);

example

fn.define('isLargeString', [ '_', function ( _ ) {

	function isLargeString (str) {
		return _.isString(str) && str.length > 45;
	}

	return isLargeString;
} ]);

fn.require(dependencies, callback)

fn.require(['dependence_1', 'dependence_2'], function ( dependence_1, dependence_1 ) {

	// your code

} ]);

fn.run(dependencies || function)

or just fn(dependencies || function)

explicit injection mode

fn.run(['dependence_1', 'dependence_2', function ( dependence_1, dependence_1 ) {

	// your code

} ]);

implicit injection mode (dependencies will be automatically detected -not recomended when uglifying code- )

fn.run(function ( dependence_1, dependence_1 ) {

	// your code

});

fn.defer(function, timeout? (0) )

fn(function () { console.log('test 1'); });
fn.defer(function () { console.log('test 2'); });
fn(function () { console.log('test 3'); });

output:

test 1
test 3
test 2

FAQs

Package last updated on 16 May 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