Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/msteckyefantis/omnipresent

Omnipresent: the npm module that lets you access your common logic everywhere🧞‍♀️. This library could be a lot better, although it's not about the code, it's about the philosophy. Disclaimer: I don't use this code myself, PRs always welcome though😁.
https://github.com/msteckyefantis/omnipresent

clean clean-code easy easy-to-use express fast global globals javascript node nodejs react reactjs simple tool web webapp webpack website

Last synced: 7 days ago
JSON representation

Omnipresent: the npm module that lets you access your common logic everywhere🧞‍♀️. This library could be a lot better, although it's not about the code, it's about the philosophy. Disclaimer: I don't use this code myself, PRs always welcome though😁.

Awesome Lists containing this project

README

        

# Omnipresent🧞‍♀️
[![npm version](https://badge.fury.io/js/omnipresent.svg)](https://badge.fury.io/js/omnipresent) [![Build Status](https://travis-ci.org/msteckyefantis/omnipresent.svg?branch=master)](https://travis-ci.org/msteckyefantis/omnipresent)

### The npm module that lets you access your common logic everywhere

#### Example:

##### Setup your global logic in any file.

```.js
'use strict';

const { addGlobally } = require( 'omnipresent' );

addGlobally({

usefulFunction: x => (2 * x),

utils: require( './utils' ),
});
```

##### Now in any file you can access your global logic by doing the following:
```.js
'use strict';

const { usefulFunction } = require( 'omnipresent' );

console.log( usefulFunction( 2 ) ); // logs 4
```