Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zkochan/kibe
A JavaScript snippet aimed to switch JavaScript references on the page for easier development/debugging/testing JavaScript files in different environments.
https://github.com/zkochan/kibe
Last synced: 10 days ago
JSON representation
A JavaScript snippet aimed to switch JavaScript references on the page for easier development/debugging/testing JavaScript files in different environments.
- Host: GitHub
- URL: https://github.com/zkochan/kibe
- Owner: zkochan
- License: mit
- Created: 2015-05-17T13:15:17.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-11-25T19:50:55.000Z (about 8 years ago)
- Last Synced: 2024-11-28T23:52:12.286Z (24 days ago)
- Language: JavaScript
- Homepage:
- Size: 26.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# kibe
A library for switching JavaScript references on the page for easier development/debugging/testing JavaScript files in different environments.
[![Dependency Status](https://david-dm.org/zkochan/kibe/status.svg?style=flat)](https://david-dm.org/zkochan/kibe)
[![Build Status](https://travis-ci.org/zkochan/kibe.svg)](https://travis-ci.org/zkochan/kibe)
[![npm version](https://badge.fury.io/js/kibe.svg)](http://badge.fury.io/js/kibe)## Installation
Minify the kibe script by running the `gulp` task and paste it to the head section of your website as inline JavaScript. Configure it in the same script tag.
## Usage example
Lets suppose you are using an A/B testing framework but you want to have the possibility to develop and test the experiments locally. The reference to the file generated by the A/B testing framework can look like `//abdomain.com/foo.js`. You'll want this script to be loaded for all your users. However, during development you'll want to suppress that script and add a reference to a local script, with the new experiment.
With kibe you can substitute JavaScript references on your website. And this will affect only your active browser.
First you have to configure it
``` js
kibe({
def: kibe.js('ab', '//abdomain.com/foo.js'),
dev: kibe.js('ab', 'http://localhost:1155/index.js')
});
```Now that kibe is on the page, you can execute `kibe('dev')` in the console of the browser and kibe will enter the dev mode. In dev mode, the localhost reference will be added to the page instead of the abdomain.com reference.
## License
The MIT License (MIT)