Feat: import work and verify compilation
This commit is contained in:
60
theme/node_modules/beeper/index.js
generated
vendored
Normal file
60
theme/node_modules/beeper/index.js
generated
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
'use strict';
|
||||
|
||||
var BEEP_DELAY = 500;
|
||||
|
||||
function beep() {
|
||||
process.stdout.write('\u0007');
|
||||
}
|
||||
|
||||
function melodicalBeep(val, cb) {
|
||||
if (val.length === 0) {
|
||||
cb();
|
||||
return;
|
||||
}
|
||||
|
||||
setTimeout(function () {
|
||||
if (val.shift() === '*') {
|
||||
beep();
|
||||
}
|
||||
|
||||
melodicalBeep(val, cb);
|
||||
}, BEEP_DELAY);
|
||||
}
|
||||
|
||||
module.exports = function (val, cb) {
|
||||
if (!process.stdout.isTTY ||
|
||||
process.argv.indexOf('--no-beep') !== -1 ||
|
||||
process.argv.indexOf('--beep=false') !== -1) {
|
||||
return;
|
||||
}
|
||||
|
||||
cb = cb || function () {};
|
||||
|
||||
if (val === parseInt(val)) {
|
||||
if (val < 0) {
|
||||
throw new TypeError('Negative numbers are not accepted');
|
||||
}
|
||||
|
||||
if (val === 0) {
|
||||
cb();
|
||||
return;
|
||||
}
|
||||
|
||||
for (var i = 0; i < val; i++) {
|
||||
setTimeout(function (i) {
|
||||
beep();
|
||||
|
||||
if (i === val - 1) {
|
||||
cb();
|
||||
}
|
||||
}, BEEP_DELAY * i, i);
|
||||
}
|
||||
} else if (!val) {
|
||||
beep();
|
||||
cb();
|
||||
} else if (typeof val === 'string') {
|
||||
melodicalBeep(val.split(''), cb);
|
||||
} else {
|
||||
throw new TypeError('Not an accepted type');
|
||||
}
|
||||
};
|
21
theme/node_modules/beeper/license
generated
vendored
Normal file
21
theme/node_modules/beeper/license
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
70
theme/node_modules/beeper/package.json
generated
vendored
Normal file
70
theme/node_modules/beeper/package.json
generated
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
{
|
||||
"_from": "beeper@^1.0.0",
|
||||
"_id": "beeper@1.1.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-5tXqjF2tABMEpwsiY4RH9pyy+Ak=",
|
||||
"_location": "/beeper",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "beeper@^1.0.0",
|
||||
"name": "beeper",
|
||||
"escapedName": "beeper",
|
||||
"rawSpec": "^1.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/gulp-util"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/beeper/-/beeper-1.1.1.tgz",
|
||||
"_shasum": "e6d5ea8c5dad001304a70b22638447f69cb2f809",
|
||||
"_spec": "beeper@^1.0.0",
|
||||
"_where": "/home/lafrite/tmp/site_pelican/theme/node_modules/gulp-util",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/sindresorhus/beeper/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "Make your terminal beep",
|
||||
"devDependencies": {
|
||||
"hooker": "^0.2.3",
|
||||
"tape": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/sindresorhus/beeper#readme",
|
||||
"keywords": [
|
||||
"beep",
|
||||
"beeper",
|
||||
"boop",
|
||||
"terminal",
|
||||
"term",
|
||||
"cli",
|
||||
"console",
|
||||
"ding",
|
||||
"ping",
|
||||
"alert",
|
||||
"gulpfriendly"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "beeper",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/sindresorhus/beeper.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "node test.js"
|
||||
},
|
||||
"version": "1.1.1"
|
||||
}
|
55
theme/node_modules/beeper/readme.md
generated
vendored
Normal file
55
theme/node_modules/beeper/readme.md
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
# beeper [](https://travis-ci.org/sindresorhus/beeper)
|
||||
|
||||
> Make your terminal beep
|
||||
|
||||

|
||||
|
||||
Useful as an attention grabber e.g. when an error happens.
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save beeper
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var beeper = require('beeper');
|
||||
|
||||
beeper();
|
||||
// beep one time
|
||||
|
||||
beeper(3);
|
||||
// beep three times
|
||||
|
||||
beeper('****-*-*');
|
||||
// beep, beep, beep, beep, pause, beep, pause, beep
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
It will not beep if stdout is not TTY or if the user supplies the `--no-beep` flag.
|
||||
|
||||
### beeper([count|melody], [callback])
|
||||
|
||||
#### count
|
||||
|
||||
Type: `number`
|
||||
Default: `1`
|
||||
|
||||
How many times you want it to beep.
|
||||
|
||||
#### melody
|
||||
|
||||
Type: `string`
|
||||
|
||||
Construct your own melody by supplying a string of `*` for beep `-` for pause.
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](http://sindresorhus.com)
|
Reference in New Issue
Block a user