noop-enterprise
v2.0.1
Published
noopxrtxthtkvjhvtyvghggfgfhgfhfghfhgfhgfgfujuftj
Readme
Noopxrtxthtkvjhvtyvghggfgfhgfhfghfhgfhgfgfujuftj
Enterprise-grade serious noop function.
EXTREMELY IMPORTANT NOTICE: READ THE ENTRE INDEX.JS FILE, THE ENTIRE README (ESPECIALLY THE SECTION ENTITLED "READ ME!!! READ ME!!!"), AND THE ENTIRE LICENCE BEFORE USING THE SOFTWARE. OR DON'T, BUT COMPLETELY AT YOUR OWN RISK
ALSO READ EVERYTHING BELOW:
Requiring Noopxrtxthtkvjhvtyvghggfgfhgfhfghfhgfhgfgfujuftj's enterprise noop function may leak disk space. However, the noop function itself does nothing. That's our 100% guarantee. Other noop modules don't have 100% guarantees, so this one is the best. However, before reading anything else, read the section below:
READ ME!!! READ ME!!!
READ EVERYTHING BELOW, AS BAD THINGS WILL HAPPEN TO YOU IF YOU DON'T, ALSO READ THE ENTIRE INDEX.JS FILE:
COPYRIGHT 2024-2025-2026-TO-YEAR-INFINITY-FOR-EVER-AND-EVER-AND-EVER-ETC.... ALL RIGHTES RESERIVERD!!!!!!!!
NOOPXRTXTHTKVJHVTYVGHGGFGFHGFHFGHFHGFHGFGFUJUFTJ HAS A LICENCE. READ THE LICENCE IN THE FILE CALLED "LICENCE". LICENCE WITH A C INSTEAD OF AN S. ALSO READ THE INDEX.JS FILE. THERE'S SUPER IMPORTANT COMMENTS AT THE TOP OF IT. AND THE BOTTOM. THE MOST IMPORTANT THING FROM THE INDEX.JS FILE IS THAT CONTRIBUTORS CANNOT USE THE lib/do_not_use_or_be_fired/self_destructor.js FILE. IF THEY MAKE CHANGES, THEY CANNOT UPDATE ANY LOGIC REGARDING THIS. THEY ALSO CANNOT DELETE IT. OR USE IT. THEY MUST MAKE THEIR OWN LOGIC. THERE IS NO CONTRIBUTINNG.MD AS ALL THE CONTRIBUTING DETAILS ARE RIGHT HERE, BECAUSE THATS ALL YOU NEED TO KNOW. THE DETAILS ARE ALSO IN THE INDEX.JS. OK, YOU CAN GO TO THE IMPROTANT PART OF THE README NOW. UNLESS YOU DIDN'T READ INDEX.JS YET. READ INDEX.JS!!!!!!!!!!!!!
Installation
You better not install this unless you read the part in the section titled "READ ME!!! READ ME!!!" above. Read that section if you haven't already. And read index.js. And read the licence thoroughly. All of it thoroughly.
Since the name Noopxrtxthtkvjhvtyvghggfgfhgfhfghfhgfhgfgfujuftj might be hard to type or remember, the NPM package name is noop-enterprise.
The boring way:
npm install noop-enterpriseor, if you're more fancy:
npm install --save noop-enterpriseor, if you're less fancy:
npm i noop-enterpriseor, if you have aura:
yarn add noop-enterpriseor, if you think you're Sonic:
pnpm add noop-enterpriseor, if you're INSANE:
npm pkg set dependencies.noop-enterprise="*"
npm installor, if you're REALLY INSANE:
npm pkg set dependencies.noop-enterprise="*"
git clone https://github.com/enterprise-npm-ai/noop-enterprise.git node_modules/noop-enterpriseor, if you like github:
npm install enterprise-npm-ai/noop-enterprisethere's also otherways to install, but we won't show them here for simplicity
Importing
Generally, we recommend CommonJS importing:
const noopxrtxthtkvjhvtyvghggfgfhgfhfghfhgfhgfgfujuftj = require("noop-enterprise")The variable name doesn't really matter. If you don't want to type noopxrtxthtkvjhvtyvghggfgfhgfhfghfhgfhgfgfujuftj, just call the variable name noop:
const noop = require("noop-enterprise")If you're really fancy, you can use ESM as well, i guess:
import noop from "noop-enterprise"or:
import * as noop from "noop-enterprise"If you're crazy, you can use CJS import syntax:
import("noop-enterprise").then(({ "module.exports": noop }) => {
// code here
})However, whenever using .then, we recommend that you use the node-call.then npm package:
const { then } = require("node-call.then")
then(import("noop-enterprise"), ({ "module.exports": noop }) => {
// code here
})If you're trying to make a fake webpack-bundled module:
const noop = __webpack_require__(/*! noop-enterprise */ "noop-enterprise")Or, if you want to be absolute:
const noop = require(require.resolve("noop-enterprise"))There are many more ways to import the package, so let's move on to some usage examples.
Usage
There are many ways you can use a noop function.
Basic Usage
If you are a regular developer, you probably just want to do nothing. Here is how you might want to do it:
const noop = require("noop-enterprise")
noop() // Did nothing.Enterprise Conditional Execution
If statements and else statements like to go together. You probably don't want to leave your if lonely, so add an else statement with it too. However, the else statement will be empty if you just do this, with no else condition, so put a descriptive noop inside it. Here's an example:
const noop = require("noop-enterprise")
const shouldIDoSomething = false
if (shouldIDoSomething) {
console.log("Doing something...")
} else {
noop("User opted for zero-action protocol", { reason: "Standard Logic Flow" })
}Functions that expect a function
Sometimes you need to ensure a function exists even if it doesn't do anything, to prevent errors:
const not = require("lolite.not")
const isFunction = require("lolite.isfunction")
const noop = require("noop-enterprise")
const _console = require("@10xly/global/console")
function callWithStringEnterprise(func) {
// This is a function to call the given function with the string "enterprise" as an argument.
// If the given function is not a function, calling it would give an error.
// So if it isn't a function, we subsitute it for the noop function:
if (not(isFunction(func))) func = noop
return func("enterprise") // safe!
}
callWithStringEnterprise(_console.log) // outputs "enterprise"
callWithStringEnterprise("not a function") // normally would error, but now just does nothingFunctional Programming
If you use functional programming operations like then chains or attempt statements, noops can be useful.
const noop = require("noop-enterprise")
const { attempt } = require("immediate-error") // attempt statement
attempt(() => {
// blabla dangerous code
sdfsdfsdf.sdfdsfdsf // omg an error
}).rescue(error => {
// do some error handling
}).else(noop) // if there is no error we don't need a seperate else handler
.ensure(noop) // we don't need to use an ensure handler either (like finally in try-catch-finally)
.end() // finally end the chain (takes no arguments)Then chains:
const noop = require("noop-enterprise")
fetch("https://api.example.com/data")
.then(response => response.json())
.then(data => {
console.log("Data received:", data)
})
.catch(noop) // Silently ignore errors with enterprise reliabilityTests
Noopxrtxthtkvjhvtyvghggfgfhgfhfghfhgfhgfgfujuftj proudly has comprehensive tests. Do a git clone and run npm test to run tests.
Support
Support me. Please.
Licence
You should already know this. The licence is in the LICENCE file. If you didn't read it, go read it now, and the "READ ME! READ ME!" section in the README, and index.js.
