diff --git a/.bithoundrc b/.bithoundrc deleted file mode 100644 index 26eeb78..0000000 --- a/.bithoundrc +++ /dev/null @@ -1,7 +0,0 @@ -{ - "critics": { - "lint": { - "engine": "tslint" - } - } -} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 33f397d..2095b4f 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,3 @@ node_modules/ pages/ public/ coverage/ -ts/typings/ \ No newline at end of file diff --git a/.npmignore b/.npmignore deleted file mode 100644 index 1e15083..0000000 --- a/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -docs/ -coverage/ diff --git a/LICENSE b/LICENSE index b249dfc..eb3beb5 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016 Push.Rocks +Copyright (c) 2016 Lossless GmbH Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 03521f9..430b366 100644 --- a/README.md +++ b/README.md @@ -2,14 +2,15 @@ minimal and fast loading plugin for startup time measuring ## Availabililty -[![npm](https://push.rocks/assets/repo-button-npm.svg)](https://www.npmjs.com/package/early) -[![git](https://push.rocks/assets/repo-button-git.svg)](https://gitlab.com/pushrocks/early) -[![git](https://push.rocks/assets/repo-button-mirror.svg)](https://github.com/pushrocks/early) -[![docs](https://push.rocks/assets/repo-button-docs.svg)](https://pushrocks.gitlab.io/early/) +[![npm](https://pushrocks.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/early) +[![git](https://pushrocks.gitlab.io/assets/repo-button-git.svg)](https://GitLab.com/pushrocks/early) +[![git](https://pushrocks.gitlab.io/assets/repo-button-mirror.svg)](https://github.com/pushrocks/early) +[![docs](https://pushrocks.gitlab.io/assets/repo-button-docs.svg)](https://pushrocks.gitlab.io/early/) ## Status for master -[![build status](https://gitlab.com/pushrocks/early/badges/master/build.svg)](https://gitlab.com/pushrocks/early/commits/master) -[![coverage report](https://gitlab.com/pushrocks/early/badges/master/coverage.svg)](https://gitlab.com/pushrocks/early/commits/master) +[![build status](https://GitLab.com/pushrocks/early/badges/master/build.svg)](https://GitLab.com/pushrocks/early/commits/master) +[![coverage report](https://GitLab.com/pushrocks/early/badges/master/coverage.svg)](https://GitLab.com/pushrocks/early/commits/master) +[![npm downloads per month](https://img.shields.io/npm/dm/early.svg)](https://www.npmjs.com/package/early) [![Dependency Status](https://david-dm.org/pushrocks/early.svg)](https://david-dm.org/pushrocks/early) [![bitHound Dependencies](https://www.bithound.io/github/pushrocks/early/badges/dependencies.svg)](https://www.bithound.io/github/pushrocks/early/master/dependencies/npm) [![bitHound Code](https://www.bithound.io/github/pushrocks/early/badges/code.svg)](https://www.bithound.io/github/pushrocks/early) @@ -18,6 +19,7 @@ minimal and fast loading plugin for startup time measuring [![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/) ## Usage +Use TypeScript for best in class instellisense. ```typescript // Put the following at the start of your module @@ -33,6 +35,6 @@ early.stop().then((loadingTime:number) => { // loadingTime in milliseconds For further information read the linked docs at the top of this README. -> MIT licensed | **©** 2016 - 2017 [Lossless GmbH](https://lossless.gmbh) +> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh) -[![npm](https://push.rocks/assets/repo-header.svg)](https://push.rocks) +[![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://push.rocks) diff --git a/dist/index.d.ts b/dist/index.d.ts index 8e7a416..a7e0412 100644 --- a/dist/index.d.ts +++ b/dist/index.d.ts @@ -1,8 +1,6 @@ -/// import 'typings-global'; -import q = require('q'); /** * start the loading */ export declare let start: (moduleNameArg?: string, loaderLengthArg?: string) => void; -export declare let stop: () => q.Promise; +export declare let stop: () => Promise; diff --git a/dist/index.js b/dist/index.js index cec3975..d36421c 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,7 +1,7 @@ "use strict"; require("typings-global"); -const chalk = require("chalk"); -const q = require("q"); +const beautycolor = require("beautycolor"); +const smartq = require("smartq"); let doText = false; let moduleName = 'undefined module name'; let startTime = Date.now(); @@ -14,16 +14,16 @@ if (process.argv.indexOf('-v') === -1) { exports.start = function (moduleNameArg = '', loaderLengthArg = '10') { moduleName = moduleNameArg; if (doText) { - console.log(`**** starting ${chalk.green(moduleNameArg)} ****`); + console.log(`**** starting ${beautycolor.coloredString(moduleNameArg, 'green')} ****`); } }; exports.stop = () => { - let done = q.defer(); + let done = smartq.defer(); let endTime = Date.now(); let earlyExecutionTime = (endTime - startTime); let earlyExecutionTimeString = (earlyExecutionTime / 1000).toString(); - console.log(`... finished loading ${moduleName} in ${earlyExecutionTimeString}`); + console.log(`... finished loading within ${beautycolor.coloredString(earlyExecutionTimeString, 'blue')}`); done.resolve(earlyExecutionTime); return done.promise; }; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsMEJBQXVCO0FBRXZCLCtCQUErQjtBQUMvQix1QkFBdUI7QUFHdkIsSUFBSSxNQUFNLEdBQVksS0FBSyxDQUFBO0FBQzNCLElBQUksVUFBVSxHQUFXLHVCQUF1QixDQUFBO0FBQ2hELElBQUksU0FBUyxHQUFHLElBQUksQ0FBQyxHQUFHLEVBQUUsQ0FBQTtBQUUxQixFQUFFLENBQUMsQ0FBQyxPQUFPLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQUMsS0FBSyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUM7SUFDcEMsTUFBTSxHQUFHLElBQUksQ0FBQTtBQUNqQixDQUFDO0FBRUQ7O0dBRUc7QUFDUSxRQUFBLEtBQUssR0FBRyxVQUFVLGFBQWEsR0FBVyxFQUFFLEVBQUUsZUFBZSxHQUFXLElBQUk7SUFDbkYsVUFBVSxHQUFHLGFBQWEsQ0F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0sQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFBO0FBQ3JCLENBQUMsQ0FBQSJ9 \ No newline at end of file diff --git a/docs/fonts/glyphicons-halflings-regular.eot b/docs/fonts/glyphicons-halflings-regular.eot deleted file mode 100644 index b93a495..0000000 Binary files a/docs/fonts/glyphicons-halflings-regular.eot and /dev/null differ diff --git a/docs/fonts/glyphicons-halflings-regular.svg b/docs/fonts/glyphicons-halflings-regular.svg deleted file mode 100644 index 94fb549..0000000 --- a/docs/fonts/glyphicons-halflings-regular.svg +++ /dev/null @@ -1,288 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/fonts/glyphicons-halflings-regular.ttf b/docs/fonts/glyphicons-halflings-regular.ttf deleted file mode 100644 index 1413fc6..0000000 Binary files a/docs/fonts/glyphicons-halflings-regular.ttf and /dev/null differ diff --git a/docs/fonts/glyphicons-halflings-regular.woff b/docs/fonts/glyphicons-halflings-regular.woff deleted file mode 100644 index 9e61285..0000000 Binary files a/docs/fonts/glyphicons-halflings-regular.woff and /dev/null differ diff --git a/docs/fonts/glyphicons-halflings-regular.woff2 b/docs/fonts/glyphicons-halflings-regular.woff2 deleted file mode 100644 index 64539b5..0000000 Binary files a/docs/fonts/glyphicons-halflings-regular.woff2 and /dev/null differ diff --git a/docs/img/glyphicons-halflings-white.png b/docs/img/glyphicons-halflings-white.png deleted file mode 100644 index 3bf6484..0000000 Binary files a/docs/img/glyphicons-halflings-white.png and /dev/null differ diff --git a/docs/img/glyphicons-halflings.png b/docs/img/glyphicons-halflings.png deleted file mode 100644 index a996999..0000000 Binary files a/docs/img/glyphicons-halflings.png and /dev/null differ diff --git a/docs/index.html b/docs/index.html deleted file mode 100644 index 181ec85..0000000 --- a/docs/index.html +++ /dev/null @@ -1,219 +0,0 @@ - - - - - - - Documentation Index - - - - - - - - - - - - - -
-
- - -
- -
- - - - - - - - - - - - - - - - - - - - - - -
-

early

minimal and fast loading animation for modules that need a little starting time.

-

Usage

// Put the following at the start of your module
-import * as early from "early";
-early.start("myModuleName");
-/*
-do your loading stuff
-*/
-early.stop(); // stop "early" when your module is ready

early runs in its own process: The loader animation runs smoothly even when your event queue of your currently loading module is working heavily.

-
- - - - - - - -
-
- -
- - -
- -
- - -
-
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/docs/quicksearch.html b/docs/quicksearch.html deleted file mode 100644 index d995a54..0000000 --- a/docs/quicksearch.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - diff --git a/docs/scripts/docstrap.lib.js b/docs/scripts/docstrap.lib.js deleted file mode 100644 index 399e753..0000000 --- a/docs/scripts/docstrap.lib.js +++ /dev/null @@ -1,11 +0,0 @@ -if(!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){function c(a){var b="length"in a&&a.length,c=_.type(a);return"function"===c||_.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}function d(a,b,c){if(_.isFunction(b))return _.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return _.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(ha.test(b))return _.filter(b,a,c);b=_.filter(b,a)}return _.grep(a,function(a){return U.call(b,a)>=0!==c})}function e(a,b){for(;(a=a[b])&&1!==a.nodeType;);return a}function f(a){var b=oa[a]={};return _.each(a.match(na)||[],function(a,c){b[c]=!0}),b}function g(){Z.removeEventListener("DOMContentLoaded",g,!1),a.removeEventListener("load",g,!1),_.ready()}function h(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=_.expando+h.uid++}function i(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(ua,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:ta.test(c)?_.parseJSON(c):c}catch(e){}sa.set(a,b,c)}else c=void 0;return c}function j(){return!0}function k(){return!1}function l(){try{return Z.activeElement}catch(a){}}function m(a,b){return _.nodeName(a,"table")&&_.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function n(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function o(a){var b=Ka.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function p(a,b){for(var c=0,d=a.length;d>c;c++)ra.set(a[c],"globalEval",!b||ra.get(b[c],"globalEval"))}function q(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(ra.hasData(a)&&(f=ra.access(a),g=ra.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)_.event.add(b,e,j[e][c])}sa.hasData(a)&&(h=sa.access(a),i=_.extend({},h),sa.set(b,i))}}function r(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&_.nodeName(a,b)?_.merge([a],c):c}function s(a,b){var c=b.nodeName.toLowerCase();"input"===c&&ya.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}function t(b,c){var d,e=_(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:_.css(e[0],"display");return e.detach(),f}function u(a){var b=Z,c=Oa[a];return c||(c=t(a,b),"none"!==c&&c||(Na=(Na||_("