console.js is a small javascript library, fix console is undefined, like html5shim and reset.css.
In ie6 ie7,console is undefined. In ie8 ie9, first open the developer tools before, console is undefined.
Download and install through the npm
$ npm install --save @jsmini/consoleIf you are use webpack
import { polyfill } from '@jsmini/console';
polyfill(); // polyfill console undefinedIf you are use requirejs
requirejs(
['node_modules/@jsmini/console/dist/index.aio.js'],
function (console_js) {
var polyfill = console_js.polyfill;
polyfill(); // polyfill console undefined
},
);If you are use browser
<script src="node_modules/@jsmini/console/dist/index.aio.js"></script>
<script>
var polyfill = console_js.polyfill;
polyfill(); // polyfill console undefined
</script>The first run requires installation of dependencies
$ npm installBuild code
$ npm run buildRun unit test, the browser environment requires manual test, in test/browser
$ npm testUpdate package.json version,update README.md version,update CHANGELOG.md,then release
$ npm run releasePush to npm
$ npm publish --access=publicYou may need to modify it as follows:
- README.md
- package.json
- config/rollup.js
- test/browser/index.html