kibe

0.2.1 • Public • Published

kibe

A library for switching JavaScript references on the page for easier development/debugging/testing JavaScript files in different environments.

Dependency Status Build Status npm version

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

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)

Readme

Keywords

Package Sidebar

Install

npm i kibe

Weekly Downloads

0

Version

0.2.1

License

MIT

Last publish

Collaborators

  • zkochan