Giter Site home page Giter Site logo

js-utils's Introduction

JS-utils Gitpod Ready-to-Code

Contributing

Read .gitpod.yml, edit code and just submit a PR.

About

Exactly what it sounds like.

A set of small tools, that every JS developer may need.

Some Encryption/Decryption functions and Thread.sleep() in JS.

Usage

If you're running it from the browser (which is an intended use scenario, btw), just download the "bin/c.js" file, which stands for "compressed.js", put it in the same folder as your script and add <script src="./c.js"></script> to the top of your HTML body.

If you're running it from the node.js, add a Git reference to this library and add a require(); to "bin/node.js".

Troubleshooting tip: If you're using node.js, type e.g. jsu.sleep(200) instead of just sleep(200).

You may want to add something else, but I'll explain that soon.

Documentation

**cryption

We provide 2 functions for that:

Encryption: encrypt(key, text) --> Encrypted text.

Decryption: decrypt(key, text) --> Decrypted text.

Troubleshooting tip: those are based on https://github.com/travist/jsencrypt library. You'll need it if you want the above functions to work. Instructions in README.md from https://github.com/travist/jsencrypt repo.

Signing

We provide 2 functions for that:

Sign: sign(key, text) --> Signed text.

Verify: verify(key, text) --> Boolean.

Troubleshooting tip: those are based on https://github.com/travist/jsencrypt library. You'll need it if you want the above functions to work. Instructions in README.md from https://github.com/travist/jsencrypt repo.

Thread.sleep();

JS doesn't have it. But it doesn't mean, you can't hack your way into it...

Sleep: sleep(ms) --> (void)

Troubleshooting tip: refer to sleeper.js for more info

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.