feat: initial commit from https://lass.js.org

This commit is contained in:
niftylettuce
2020-07-07 10:19:48 -05:00
commit 33812e316e
17 changed files with 7346 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
{
"extends": [
"@commitlint/config-conventional"
]
}
+9
View File
@@ -0,0 +1,9 @@
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
+1
View File
@@ -0,0 +1 @@
* text=auto
+24
View File
@@ -0,0 +1,24 @@
# OS #
###################
.DS_Store
.idea
Thumbs.db
tmp/
temp/
# Node.js #
###################
node_modules
# NYC #
###################
coverage
*.lcov
.nyc_output
# Files #
###################
*.log
+6
View File
@@ -0,0 +1,6 @@
{
"hooks": {
"pre-commit": "lint-staged && npm test",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
}
+7
View File
@@ -0,0 +1,7 @@
module.exports = {
"*.md,!test/**/*.md": [
filenames => filenames.map(filename => `remark ${filename} -qfo`)
],
'package.json': 'fixpack',
'*.js': 'xo --fix'
};
+14
View File
@@ -0,0 +1,14 @@
{
"extension": [
".js"
],
"report-dir": "./coverage",
"temp-dir": "./.nyc_output",
"check-coverage": true,
"lines": 100,
"functions": 100,
"branches": 100,
"reporter": ["lcov", "html", "text"]
}
+5
View File
@@ -0,0 +1,5 @@
{
"singleQuote": true,
"bracketSpacing": true,
"trailingComma": "none"
}
+1
View File
@@ -0,0 +1 @@
test/snapshots/**/*.md
+5
View File
@@ -0,0 +1,5 @@
{
"plugins": [
"preset-github"
]
}
+11
View File
@@ -0,0 +1,11 @@
language: node_js
node_js:
- 10
- 12
- 14
- 'lts/*'
- 'node'
script:
- npm run test-coverage
after_success:
- npm run coverage
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2020 Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.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.
+65
View File
@@ -0,0 +1,65 @@
# [**@ladjs/cron**](https://github.com/ladjs/cron)
[![build status](https://img.shields.io/travis/com/ladjs/cron.svg)](https://travis-ci.com/ladjs/cron)
[![code coverage](https://img.shields.io/codecov/c/github/ladjs/cron.svg)](https://codecov.io/gh/ladjs/cron)
[![code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo)
[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
[![made with lass](https://img.shields.io/badge/made_with-lass-95CC28.svg)](https://lass.js.org)
[![license](https://img.shields.io/github/license/ladjs/cron.svg)](LICENSE)
[![npm downloads](https://img.shields.io/npm/dt/@ladjs/cron.svg)](https://npm.im/@ladjs/cron)
> The best job scheduler for Node.js with support for cron, ms, and human-friendly strings. Uses workers and spawns sandboxed processes. Supports async/await, retries, throttling, concurrency, and cancelable promises (graceful shutdown). Simple, fast, and the most lightweight tool for the job. Made for Lad.
## Table of Contents
* [Install](#install)
* [Usage](#usage)
* [Contributors](#contributors)
* [License](#license)
## Install
[npm][]:
```sh
npm install @ladjs/cron
```
[yarn][]:
```sh
yarn add @ladjs/cron
```
## Usage
```js
const @ladjs/cron = require('@ladjs/cron');
const @ladjs/cron = new @ladjs/cron();
console.log(@ladjs/cron.renderName());
// script
```
## Contributors
| Name | Website |
| -------------- | -------------------------- |
| **Nick Baugh** | <http://niftylettuce.com/> |
## License
[MIT](LICENSE) © [Nick Baugh](http://niftylettuce.com/)
##
[npm]: https://www.npmjs.com/
[yarn]: https://yarnpkg.com/
+14
View File
@@ -0,0 +1,14 @@
class Script {
constructor(config) {
config = { ...config };
this._name = config.name || 'script';
this.renderName = this.renderName.bind(this);
}
renderName() {
return this._name;
}
}
module.exports = Script;
+130
View File
@@ -0,0 +1,130 @@
{
"name": "@ladjs/cron",
"description": "The best job scheduler for Node.js with support for cron, ms, and human-friendly strings. Uses workers and spawns sandboxed processes. Supports async/await, retries, throttling, concurrency, and cancelable promises (graceful shutdown). Simple, fast, and the most lightweight tool for the job. Made for Lad.",
"version": "0.0.0",
"author": "Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.com/)",
"bugs": {
"url": "https://github.com/ladjs/cron/issues",
"email": "niftylettuce@gmail.com"
},
"contributors": [
"Nick Baugh <niftylettuce@gmail.com> (http://niftylettuce.com/)"
],
"dependencies": {},
"devDependencies": {
"@commitlint/cli": "latest",
"@commitlint/config-conventional": "latest",
"ava": "latest",
"codecov": "latest",
"cross-env": "latest",
"eslint": "6.x",
"eslint-config-xo-lass": "latest",
"fixpack": "latest",
"husky": "latest",
"lint-staged": "latest",
"nyc": "latest",
"remark-cli": "latest",
"remark-preset-github": "latest",
"xo": "0.25"
},
"engines": {
"node": ">= 10"
},
"homepage": "https://github.com/ladjs/cron",
"keywords": [
"agenda",
"async",
"await",
"bee",
"bull",
"callback",
"cancel",
"cancelable",
"clear",
"cron",
"cronjob",
"crontab",
"date",
"day",
"dayjs",
"delay",
"english",
"express",
"expression",
"frequencies",
"frequency",
"frequent",
"friendly",
"graceful",
"human",
"humans",
"interval",
"job",
"job",
"jobs",
"koa",
"koatiming",
"lad",
"lass",
"later",
"moment",
"mongo",
"mongodb",
"mongoose",
"mongoose",
"p-cancel",
"p-cancelable",
"p-retry",
"parse",
"parser",
"pretty",
"promise",
"queue",
"queues",
"readable",
"recur",
"recurring",
"redis",
"reload",
"restart",
"run",
"runner",
"schedule",
"scheduler",
"setup",
"tab",
"task",
"tasker",
"time",
"timeout",
"timer",
"timers",
"translated",
"universalify"
],
"license": "MIT",
"main": "index.js",
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/ladjs/cron"
},
"scripts": {
"coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov",
"lint": "yarn run lint:js && yarn run lint:md",
"lint:js": "xo",
"lint:md": "remark . -qfo",
"pretest": "yarn run lint",
"test": "cross-env NODE_ENV=test ava",
"test-coverage": "cross-env NODE_ENV=test nyc yarn run test"
},
"xo": {
"prettier": true,
"space": true,
"extends": [
"xo-lass"
]
}
}
+27
View File
@@ -0,0 +1,27 @@
const test = require('ava');
const Script = require('..');
test.beforeEach(t => {
const script = new Script({});
Object.assign(t.context, { script });
});
test('returns itself', t => {
t.true(t.context.script instanceof Script);
});
test('sets a config object', t => {
const script = new Script(false);
t.true(script instanceof Script);
});
test('renders name', t => {
const { script } = t.context;
t.is(script.renderName(), 'script');
});
test('sets a default name', t => {
const { script } = t.context;
t.is(script._name, 'script');
});
+7001
View File
File diff suppressed because it is too large Load Diff