Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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😁.
- Host: GitHub
- URL: https://github.com/msteckyefantis/omnipresent
- Owner: msteckyefantis
- Created: 2018-06-07T15:03:48.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-07-22T21:10:06.000Z (over 6 years ago)
- Last Synced: 2024-11-23T22:18:14.274Z (2 months ago)
- Topics: clean, clean-code, easy, easy-to-use, express, fast, global, globals, javascript, node, nodejs, react, reactjs, simple, tool, web, webapp, webpack, website
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/omnipresent
- Size: 35.2 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
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
```