Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

is-stupid

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-stupid

Roses are red, you are stupid

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Is stupid npm version

A package to figure out if one is stupid.

Get Started

Installation

  1. Install using npm :

    npm i is-stupid
    
  2. Install using yarn:

    yarn install is-stupid
    
  3. With Deno:

    import isStupid from 'https://unpkg.com/is-stupid/dist/index.js'
    

Basic Usage

This package uses both default exports and named exports, as such, it requires ES modules to be used.

For modern environments with ES module support (such as typescript, or usage with bundlers):

import isStupid from 'is-stupid';

if (isStupid) {
    console.log('oh no');
}

In CommonJS environments (such as Node), you may use esm to import it:

const isStupid = require('esm')(module)('is-stupid');

API

[default]: boolean

A pre-calculated value for performance reasons.

import isStupid from 'is-stupid';

isStupid;

recalculate: () => boolean

Do calculation during runtime for maximum accuracy.

import { recalculate } from 'is-stupid';

recalculate();

smartRecalculate: () => StupidItem

Use heuristics, as well as additional utility functions. Can be slower than above functions.

import { smartRecalculate } from 'is-stupid';

smartRecalculate();

StupidItem: class extends Boolean

An item wrapping around Boolean to provide further functionality.

StupidItem.IS_SURE: boolean

A variable indicating how sure the item is.

StupidItem.IS_SURE
StupidItem.prototype.isSureAboutBeingSure: () => boolean

Attempt to persuade the item.

smartRecalculate()
    .isSureAboutBeingSure()
StupidItem.prototype.takeSomeTimeToRethinkIsSure: () => Promise<boolean>

Asynchronously give time for the item to think about it.

await smartRecalculate()
    .takeSomeTimeToRethinkIsSure()
StupidItem.prototype.takeSomeTimeToRethinkIsSureSync: () => boolean

Synchronously give time for the item to think about it.

await smartRecalculate()
    .takeSomeTimeToRethinkIsSureSync()
StupidItem.prototype[Symbol.toPrimitive]: () => boolean

Converts the item to a primitive.

stupidItem[Symbol.toPrimitive]()

Testing

Install dev-dependencies, then test:

$ npm i -D && npm t

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Author

Jason Lim

License

Copyright © 2021 Jason Lim. Released under the WTFPL license.

Keywords

FAQs

Package last updated on 16 Jan 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc