GithubHelp home page GithubHelp logo

anthrax3 / pipejs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sebastienros/pipejs

0.0 1.0 0.0 144 KB

Command Line JavaScript interpreter

License: MIT License

C# 97.25% JavaScript 2.75%

pipejs's Introduction

PipeJs

PipeJs is a JavaScript Command Line Interpreter for .NET. It means you can execute custom JavaScript from the command line, by passing JavaScript statements and script files as arguments.

Quick Start

PipeJs is used by calling pipejs.exe from the command line. Here are some typical ways to use it:

Returning a JavaScript primitive value

Any returned primitive value is displayed using .toString() on it.

pipejs return Math.PI * 2

6.28318530717959

Returning a JavaScript complex object

Complex objects are serialized into JSON.

pipejs var o = {}; o.Color = 'Red'; return o;

{"Color":"Red"}

Piping arguments to a script

Any value can be passed to pipejs as the this argument.

echo { "foo" : "bar" } | pipejs return this.foo;

bar

Outputing custom text to the console

The console object is available.

echo 9 | pipejs "if(this > 5) console.log(this); else console.warning(this);"

Using an external script file

PipeJs can execute a script from a specific file.

pipejs @myScript.js

Piping outputs to inputs

The output of a pipejs script can be used as the input of another one.

echo 9 | pipejs return this * 2 | pipejs return this - 10

8

pipejs's People

Contributors

sebastienros avatar

Watchers

 avatar

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.