Giter Club home page Giter Club logo

noop3's Introduction


noop3


◻️ Supreme nothingness

Build Status Coverage Status

Install

$ npm install noop3

Usage

const noop = require('noop3');

function unicorn(fn) {
	fn = fn || noop;
	return fn('unicorn');
}
unicorn();

// Also compatible with non-mythical single horned creatures
function narwhal(fn) {
	fn = fn || noop;
	return fn('narwhal');
}
narwhal();

// Using the noop factory
const fn = require('noop3/factory');
const rainbow = fn();
const flowers = fn();
console.log(rainbow === flowers);
//=> false

rainbow();
//=> undefined

Related

License

MIT © Sindre Sorhus

noop3's People

Contributors

dasilvacontin avatar dylanpiercey avatar laat avatar sindresorhus avatar tonylukasavage avatar yeti-or avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

noop3's Issues

We need a enterprisy noop factory.

With a noop-factory this module could fill a nice niche.

var assert = require('assert');
var fn = require('noop3').factory;

var A = fn();
var B = fn();

var obj = { A, B };

assert.equal(obj.A(), undefined);

assert.equal(obj.A, A);
assert.equal(obj.B, B);
assert.notEqual(obj.B, A);

performance tests and comparisons

Do we know how fast noop3 is?

How much faster is it than lodash.noop?

Or jQuery.noop?

We should also experiment with using child processes or Web Workers to offload the task of doing nothing so that we can do nothing without blocking the main thread.

Support tree-shaking

It would be nice if noop3 would include a module field in the package.json, which points to an ES6 module version of the code. This allows tools like Rollup to do tree-shaking on it.

more convenient

maybe adding compressed and gzipped sizes would be helpful

love it
achim

add .eslintrc

I'm not comfortable with using code that's not linted. Like, are you kidding me? What if someone submits a PR without a semicolon or an incompatible indentation style? And typos might go unnoticed too. Please add linting as soon as possible.

missing exports & package fields

missing package fields:

  • main
  • jsnext:main
  • dev:main
  • minified:main
  • module
  • web

missing exports:

  • noop.noop
  • noop.default
  • noop.__esModule
  • function.name
  • global.noop
  • window.noop
  • node-gyp bindings to auto require noop globally

Refresh package (update major version)

  • The code is pretty old
  • This package used as non-development dependency impacts perfomance (ex. "is-thirteen")
  • We should use modern technologies as said in #1
    Also I suggest to use a vanilla.js/semicolon.js (because vapor.js is lacking security).

Needs more extensive testing

Currently tests only check that function returns undefined, which doesn't guarantee that it does really NOTHING. Needs more detailed tests that check against all the possible side-effects by comparing snapshots of environment before and after execution.

needs 500% test coverage; Nothing should not do anything.

Currently, you have 100% test coverage, which normally is sufficient, but when you are testing the incalculable vast of nothingness, you need test coverage that gets you closer to Infinity%.

We can start by testing that nothing doesn't do anything, and increasing the code coverage to 500%.

test('nothing should not do anything', t => {
    t.throws(() => {
        noop3().doSomething();
        noop3().doAnythingAtAll();
        noop3().seriouslyJustTrySomethingSimpleItIsAllWeAsk();
        noop3().pleaseGetOffYourLazyUnicornBumAndDoSomethingForOnce();
    });
});

Not webscale enough

Hi, I would love to use this module for my upcoming hip startup social network, but I'm afraid it'll be too slow. I need it to support async and possibly those "promises" things? I'm not sure yet if I'll need those too. Please fix asap.

Thanks

Weird characters in issues page

screen shot 2018-05-06 at 1 22 27 pm

Not sure if this is on purpose or if there is something going wrong with GitHub atm.
I checked on:

  • Chrome 66, macOS High Sierra 10.13.4
  • FireFox Developer Edition 61.0b2, macOS High Sierra 10.13.4
  • Chrome for Android

security issue

noop3 is amazing thing, but I'm afraid it's not secure enough. Can we implement a military 8192 bit algorithm encryption?

Lacking Critical Support

Needs support for:

  • No CommonJS
  • ES6 modules
  • ES7 async functions
  • MongoDB 3.2 & Postgresql

Can we also get some examples with non-mythical creatures that have single protruding horns? Personally would love to see a narwhal-based example.

how to dislike a package? #ï͂͑̉͆ͧͮͩ̓ͧ̒͒̉̎̂̊͆͑͐̊̓̊̅ͭ͗̐̄̏̾̄͊ͭͥ̐ͭ͊͐̉͗ͪ͐͊̽ͮ͑ͬͨͤ͒ͦ̿̈̽ͭͤ̃͌͂̅̄ͨ̐̐ͮͭͪ̈̑͐ͥ̊ͮͩ͋ͫ͂̇̐ͣ͒̊̅ͥ̓͐͊̍̑́̾̋̑̎́̍̔͐̓̃̀͆ͭͩ̌͒ͣ͆̒ͯ̎ͯ͒ͩ̐̓ͩͫ̃͑͋̓͆̎́̑͋̊̐́͐ͧ̀͛ͩ̐̓ͩ̚#ï͂͑̉͆ͧͮͩ̓ͧ̒͒̉̎̂̊͆͑͐̊̓̊̅ͭ͗̐̄̏̾̄͊ͭͥ̐ͭ͊͐̉͗ͪ͐͊̽ͮ͑ͬͨͤ͒ͦ̿̈̽ͭͤ̃͌͂̅̄ͨ̐̐ͮͭͪ̈̑͐ͥ̊ͮͩ͋ͫ͂̇̐ͣ͒̊̅ͥ̓͐͊̍̑́̾̋̑̎́̍̔͐̓̃̀͆ͭͩ̌͒ͣ͆̒ͯ̎ͯ͒̚

you have done a lot of "̋̏̏̏̋̏̏̋̋̏̏̋̋̏̋̏̋̏̏̋̏̏̋̋̏̏̏̋̋̏̋̋̏̏̋̋̋̏̏̋̋̋̋̋̏̋̏̏̏̋̏̏̏̋̋̏̏̋̋̋̏̋̏̋̋̋̋̏̏̏̋̏̏̋̋̏̋̏̋̋̋̋̏̏̏̋̋̏̋̏̏̋̋̋̋̋̋̋̋̏̋̏̏̏̏̏̏̋̏̋̏̏̏̋̋̏̏̏̏̋̏̋̋̋̋̏̏̏̋̋̋̋̋̏̏̏̏̏̋ه҈̿҈̿҈̿҈̿҈̿҈̿҈̿҈̿҈̿҈̿҈̿҈̿҈̿҈ه҈̿҈̿҈̿҈̿҈̿҈̿҈̿҈̿҈̿҈̿҈̿҈̿҈̿҈ه҈̿҈̿҈̿҈̿҈̿҈̿҈̿҈̿҈̿҈̿҈̿҈̿҈̿҈ه҈̿҈̿҈̿҈̿҈̿҈̿҈̿҈̿҈̿҈̿҈̿҈̿҈̿҈ه҈̿ useful things, but those kind of things make me belive we fucking lost the cursor of software development, i don't like this package, is there any way to dislike a github project?

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.