GithubHelp home page GithubHelp logo

tunnckocore / dush-methods Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 500 KB

Plugin for `dush` and anything based on it. It adds helper `.define` and `.delegate` methods

License: MIT License

JavaScript 100.00%
dushplugin baseplugin minibaseplugin define delegate helpers microscopic

dush-methods's Introduction

dush-methods npm version github tags mit license

Plugin for dush and anything based on it. It adds helper .define and .delegate methods

You might also be interested in dush-tap-report.

Quality πŸ‘Œ

By using commitizen and conventional commit messages, maintaining meaningful ChangeLog and commit history based on global conventions, following StandardJS code style through ESLint and having always up-to-date dependencies through integrations like GreenKeeper and David-DM service, this package has top quality.

code climate code style commitizen friendly greenkeeper friendly dependencies

Stability πŸ’―

By following Semantic Versioning through standard-version releasing tool, this package is very stable and its tests are passing both on Windows (AppVeyor) and Linux (CircleCI) with results from 100% to 400% test coverage, reported respectively by CodeCov and nyc (istanbul).

following semver semantic releases linux build windows build code coverage nyc coverage

Support πŸ‘

If you have any problems, consider opening an issue, ping me on twitter (@tunnckoCore), join the support chat room or queue a live session on CodeMentor with me. If you don't have any problems, you're using it somewhere or you just enjoy this product, then please consider donating some cash at PayPal, since this is OPEN Open Source project made with love at Sofia, Bulgaria πŸ‡§πŸ‡¬.

tunnckoCore support code mentor paypal donate NPM monthly downloads npm total downloads

Table of Contents

(TOC generated by verb using markdown-toc)

Install

Install with npm

$ npm install dush-methods --save

or install using yarn

$ yarn add dush-methods

Usage

For more use-cases see the tests

const dushMethods = require('dush-methods')

API

Plugin for dush, minibase, base and anything based on them. It adds .define and .delegate methods on the app instance.

  • returns {Function}: a plugin function that should be passed to .use method

Example

const dush = require('dush')
const methods = require('dush-methods')

const app = dush()
app.use(methods())

console.log(app.define) // => function
console.log(app.delegate) // => function

Add non-enumerable prop with a value. It also emits a define event.

Params

  • prop {String}: a name of the property
  • value {any}: any type of value
  • returns {Object}: instance for chaining

Example

app.define('foo', 123)
console.log(app.foo) // => 123

app.on('define', (key, value) => {
  console.log('key:', key) // => 'key: foo'
  console.log('value:', value) // => 'value: 123'
})

// or inside plugin
app.use((app) => {
  app.define('hello', (place) => console.log(`Hello ${place}!`))
})

app.hello('world') // => 'Hello world!'

Calls the .define method for each property on props object. It also emits delegate event.

Params

  • props {Object}: an object of properties
  • returns {Object}: instance for chaining

Example

// called two times
app.on('define', (key, value) => {
  console.log(key) // => `foo`, then `qux`
  console.log(value) // => `bar`, then `123`
})

// called one time
app.on('delegate', (props) => {
  console.log('props:', props) // => { foo: 'bar', qux: 123 }
})

app.delegate({
  foo: 'bar',
  qux: 123
})

Related

  • dush-methods: Plugin for dush and anything based on it. It adds helper .define and .delegate methods | homepage
  • dush-no-chaining: A plugin that removes the emitter methods chaining support for dush, base, minibase or anything based on them | homepage
  • dush-options: Adds .option, .enable and .disable methods to your dush application | homepage
  • dush-promise: Plugin for dush that makes it a Deferred promise and adds .resolve, .reject, .than and .catch methods for more better… more | homepage
  • dush-router: A simple regex-based router for dush, base, minibase and anything based on them. Works on Browser and Node.js | homepage
  • dush-tap-report: A simple TAP report producer based on event system. A plugin for dush event emitter or anything based on it | homepage
  • dush: Microscopic & functional event emitter in ~260 bytes, extensible through plugins. | homepage
  • gibon: Functional client-side router in ~570 bytes, built on HTML5 History API | homepage
  • gruu-api: Core API for Gruu and Mukla - Minimal, modern and extensible test runners | homepage

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Please read the contributing guidelines for advice on opening issues, pull requests, and coding standards.
If you need some help and can spent some cash, feel free to contact me at CodeMentor.io too.

In short: If you want to contribute to that project, please follow these things

  1. Please DO NOT edit README.md, CHANGELOG.md and .verb.md files. See "Building docs" section.
  2. Ensure anything is okey by installing the dependencies and run the tests. See "Running tests" section.
  3. Always use npm run commit to commit changes instead of git commit, because it is interactive and user-friendly. It uses commitizen behind the scenes, which follows Conventional Changelog idealogy.
  4. Do NOT bump the version in package.json. For that we use npm run release, which is standard-version and follows Conventional Changelog idealogy.

Thanks a lot! :)

Building docs

Documentation and that readme is generated using verb-generate-readme, which is a verb generator, so you need to install both of them and then run verb command like that

$ npm install verbose/verb#dev verb-generate-readme --global && verb

Please don't edit the README directly. Any changes to the readme must be made in .verb.md.

Running tests

Clone repository and run the following in that cloned directory

$ npm install && npm test

Author

Charlike Mike Reagent

License

Copyright Β© 2017, Charlike Mike Reagent. Released under the MIT License.


This file was generated by verb-generate-readme, v0.4.3, on April 02, 2017.
Project scaffolded using charlike cli.

dush-methods's People

Contributors

greenkeeper[bot] avatar tunnckocore avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

dush-methods's Issues

An in-range update of nyc is breaking the build 🚨

Version 10.3.0 of nyc just got published.

Branch Build failing 🚨
Dependency nyc
Current Version 10.2.2
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As nyc is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ

Status Details - ❌ **continuous-integration/appveyor/branch** Waiting for AppVeyor build to complete [Details](https://ci.appveyor.com/project/tunnckoCore/dush-methods/build/1.0.37),- ❌ **bitHound - Dependencies** 3 failing dependencies. [Details](https://www.bithound.io/github/tunnckoCore/dush-methods/52f6a549f688e4755fc2d386dc1a3c28043d1804/dependencies/npm#filter-failing-dep),- βœ… **bitHound - Code** No failing files. [Details](https://www.bithound.io/github/tunnckoCore/dush-methods/52f6a549f688e4755fc2d386dc1a3c28043d1804/files?status=passing),- βœ… **ci/circleci** Your tests passed on CircleCI! [Details](https://circleci.com/gh/tunnckoCore/dush-methods/19?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link)

Commits

The new version differs by 4 commits ahead by 4, behind by 2.

  • 55e826d chore(release): 10.3.0
  • 89dc7a6 chore: explicit update of istanbul dependnecies (#562)
  • 1887d1c feat: add support for --no-clean, to disable deleting raw coverage output (#558)
  • ff73b18 fix: source-maps were not being cached in the parent process when --all was being used (#556)

false

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of standard-version is breaking the build 🚨

Version 4.2.0 of standard-version just got published.

Branch Build failing 🚨
Dependency standard-version
Current Version 4.1.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As standard-version is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • βœ… bitHound - Code No failing files. Details
  • ❌ bitHound - Dependencies 4 failing dependencies. Details
  • ❌ ci/circleci Your tests failed on CircleCI Details
  • ❌ continuous-integration/appveyor/branch AppVeyor build failed Details

Commits

The new version differs by 2 commits.

  • 2790e08 chore(release): 4.2.0
  • bc0fc53 feat: add support for package-lock.json (#190)

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of dush is breaking the build 🚨

Version 3.0.5 of dush just got published.

Branch Build failing 🚨
Dependency dush
Current Version 3.0.4
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As dush is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ ci/circleci Your tests are queued behind your running builds Details
  • ❌ continuous-integration/appveyor/branch Waiting for AppVeyor build to complete Details
  • ❌ bitHound - Dependencies 4 failing dependencies. Details
  • βœ… bitHound - Code No failing files. Details

Commits

The new version differs by 8 commits.

  • 7c403dd chore(release): 3.0.5
  • c7162ce fix(update): add eslintrc and format the codebase
  • f3f75a8 chore(package): update standard to version 10.0.1
  • 39140c7 Update rollup-plugin-uglify to version 2.0.1 πŸš€ (#16)
  • eae6639 Merge branch 'master' into greenkeeper-rollup-plugin-uglify-2.0.1
  • ba113a8 Merge pull request #14 from tunnckoCore/greenkeeper-standard-10.0.2
  • 4d8869c chore(package): update rollup-plugin-uglify to version 2.0.1
  • 74f9cac chore(package): update standard to version 10.0.2

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of dush is breaking the build 🚨

Version 3.0.3 of dush just got published.

Branch Build failing 🚨
Dependency dush
Current Version 3.0.2
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As dush is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ


Status Details
  • ❌ ci/circleci CircleCI is running your tests Details

  • ❌ continuous-integration/travis-ci/push The Travis CI build is in progress Details

  • ❌ continuous-integration/appveyor/branch Waiting for AppVeyor build to complete Details

  • βœ… bitHound - Code No failing files. Details

  • ❌ bitHound - Dependencies 3 failing dependencies. Details

Commits

The new version differs by 2 commits .

  • 81d4018 chore(release): 3.0.3
  • c6972dd fix(readme): update plugins list and github tag badge link

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of nyc is breaking the build 🚨

Version 10.2.0 of nyc just got published.

Branch Build failing 🚨
Dependency nyc
Current Version 10.1.2
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As nyc is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ


Status Details
  • ❌ continuous-integration/appveyor/branch Waiting for AppVeyor build to complete Details

  • ❌ continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

Commits

The new version differs by 6 commits .

  • 455619f chore(release): 10.2.0
  • 95cc09a feat: upgrade to version of yargs with extend support (#541)
  • 43535f9 chore: explicit update of istanbuljs dependencies (#535)
  • 98ebdff feat: allow babel cache to be enabled (#517)
  • 50adde4 feat: exclude the coverage/ folder by default πŸš€ (#502)
  • 6a59834 chore(package): update tap to version 10.0.0 (#507)

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of nyc is breaking the build 🚨

Version 10.3.2 of nyc just got published.

Branch Build failing 🚨
Dependency nyc
Current Version 10.3.1
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As nyc is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ continuous-integration/appveyor/branch Waiting for AppVeyor build to complete Details,- ❌ bitHound - Dependencies 3 failing dependencies. Details,- βœ… bitHound - Code No failing files. Details,- βœ… ci/circleci Your tests passed on CircleCI! Details

Commits

The new version differs by 2 commits0.

  • e062a86 chore(release): 10.3.2
  • 213206f fix: we should not create a cache folder if cache is false (#567)

false

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of dush is breaking the build 🚨

Version 3.0.1 of dush just got published.

Branch Build failing 🚨
Dependency dush
Current Version 3.0.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As dush is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ


Status Details
  • ❌ ci/circleci CircleCI is running your tests Details

  • ❌ continuous-integration/travis-ci/push The Travis CI build is in progress Details

  • ❌ continuous-integration/appveyor/branch Waiting for AppVeyor build to complete Details

  • ❌ bitHound - Dependencies 3 failing dependencies. Details

  • βœ… bitHound - Code No failing files. Details

Commits

The new version differs by 7 commits .

  • 62750cd chore(release): 3.0.1
  • 5b1fa43 fix(readme): add list of plugins
  • af1bc04 fix(readme): include ToC
  • 671d2eb docs(readme): tweaks
  • e9321a2 fix(readme): update boilerplate
  • 17bd948 fix(ci): move to CircleCI, instead of TravisCI
  • 7d6c4e2 fix(index): make detection "sourceString" more private

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of dush is breaking the build 🚨

Version 3.0.4 of dush just got published.

Branch Build failing 🚨
Dependency dush
Current Version 3.0.3
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As dush is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ


Status Details
  • ❌ ci/circleci CircleCI is running your tests Details

  • ❌ continuous-integration/appveyor/branch Waiting for AppVeyor build to complete Details

  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details

Commits

The new version differs by 3 commits .

  • 043da3f chore(release): 3.0.4
  • 958ed95 fix(.use): allow passing options as second argument
  • 630518e chore(package): GreenKeeper enabled, update all dependencies (#11)

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of nyc is breaking the build 🚨

Version 11.0.2 of nyc just got published.

Branch Build failing 🚨
Dependency nyc
Current Version 11.0.1
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As nyc is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ continuous-integration/appveyor/branch Waiting for AppVeyor build to complete Details
  • ❌ bitHound - Dependencies 3 failing dependencies. Details
  • βœ… bitHound - Code No failing files. Details
  • ❌ ci/circleci Your tests failed on CircleCI Details

Commits

The new version differs by 2 commits.

  • e4eff12 chore(release): 11.0.2
  • 0c2ef43 chore: upgrade to newer version of spawn-wrap (#592)

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.