Have ideas to improve npm?Join in the discussion! »

    just-modulo
    TypeScript icon, indicating that this package has built-in type declarations

    1.2.1 • Public • Published

    just-modulo

    Part of a library of zero-dependency npm modules that do just do one thing. Guilt-free utilities for every occasion.

    import modulo from 'just-modulo';
    
    modulo(7, 5); // 2
    modulo(17, 23); // 17
    modulo(16.2, 3.8); // 1
    modulo(5.8, 3.4); //2.4
    modulo(4, 0); // 4
    modulo(-7, 5); // 3
    modulo(-2, 15); // 13
    modulo(-5.8, 3.4); // 1
    modulo(12, -1); // NaN
    modulo(-3, -8); // NaN
    modulo(12, 'apple'); // NaN
    modulo('bee', 9); // NaN
    modulo(null, undefined); // NaN
    

    Install

    npm i just-modulo

    DownloadsWeekly Downloads

    1

    Version

    1.2.1

    License

    MIT

    Unpacked Size

    3 kB

    Total Files

    6

    Last publish

    Collaborators

    • avatar