Giter VIP home page Giter VIP logo

carpenter's Introduction

Carpenter ๐Ÿ› 

Documentation

Road ๐Ÿ—บ

  • Add ARGS (deno.args) carpenter
  • Add OS (deno.build) carpenter
  • Add STRING carpenter
  • Add ARRAY carpenter
  • Add SWITCH carpenter
  • Add OBJECT carpenter
  • Add VALUE carpenter (unknown values)
  • Add more options to STRING carpenter
  • Add more interconnections between various carpenters

By example

OS specific code

import { OS } from "./mod.ts";

// basic
OS.on("darwin").do(() => console.log("Hey Darwin"));
OS.on("darwin").do(() => console.log("Hey Darwin")).else(() =>
  console.log("something else")
);
// multiple clauses
let str = "";
OS.on("windows")
  .do(() => str += "Hello ")
  .do(() => str += "world");

Command line argument specific code

import {ARGS} from "./mod.ts";

// basic usage
ARGS.on("-h")
    .do(() => some help code here)
    .else(() => -h was not found);

// multiple flags (evaluates when all flags are set)
ARGS.on("-x", "-a")
    .do(()=> console.log("flag -x and -a was found together"))

Other carpenters

For more carpenters see documentation.

import { STRING } from "./mod.ts";

STRING("hello")
  .contains("hello").and().contains("x") // false
  .or().isOfSize(5) // true
  .do(() => console.log("OH WOW!!!!")) // true because of OR operator
;

STRING("hello")
  .adapt((prev: string) => prev += " world") // adapts the string.. you may continue with chaining after this
  .getValue(); // gets the current object value.
import { SWITCH } from "./mod.ts";

SWITCH(someValue)
  .case("one").do(() => {})
  .case("chain")
  .do(() => {})
  .do(() => {})
  .default(() => {});

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.