Code Monkey home page Code Monkey logo

cli's Introduction

Autocode Setup | Node | Web | Python (alpha) | Ruby (alpha)

Introduction

Autocode is a fastest and easy way to build web services and APIs that respond to external SaaS events. The Autocode ecosystem treats external SaaS APIs as single-line function calls with the use of the lib package in NPM. The Autocode CLI allows you to interact seamlessly with the following components of Autocode:

  1. Executing APIs on the Autocode standard library
  2. Uploading new APIs / web services to Autocode's hosting platform

Autocode is based on Function as a Service ("serverless") architecture, initially popularized by AWS Lambda. You can use Autocode to build modular, scalable APIs for yourself and other developers in minutes without having to manage servers, gateways, domains, write documentation, or build SDKs. Your development workflow has never been easier - focus on writing code you love, let Autocode handle everything else.

Autocode uses an open specification called FunctionScript for function definitions and execution. If you run into concerns or questions as you're building from this guide, please reference the FunctionScript repository. :)

You can view services published by our large and growing developer community on the Autocode standard library page.

lib-process

Table of contents

  1. Getting started
  2. Creating your first service
  3. Connecting service endpoints
  4. Accessing your APIs from other applications
  5. Accessing your APIs over HTTP
  6. Version control and package management
  7. Logging
  8. Additional functionality
  9. Acknowledgements
  10. Contact

Getting started

To get started with Autocode, first make sure you have Node 8.x or later installed, available from the official Node.js website. Next install the Autocode CLI tools with:

$ npm install lib.cli -g

And you're now ready to start building!

Creating your first service

The first thing you'll want to do is create a workspace. Create a new directory you intend to build your services in and initialize the workspace.

$ mkdir autocode-workspace
$ cd autocode-workspace
$ lib init

You'll be asked for an e-mail address to log in to the Autocode registry. If you don't yet have an account, you can create one by going to https://autocode.com/. Note that you can skip account creation with lib init --no-login. You'll be unable to use the registry, but it's useful for creating workspaces when you don't have internet access.

Next, create your service:

$ lib create <service>

You'll be asked for a default function name, which is the entry point into your service (useful if you only want a single entry point). This will automatically generate a service project scaffold in autocode-workspace/<username>/<service>.

Once created, enter the service directory:

$ cd your_username/your_service

In this directory, you'll see something like:

- functions/
  - __main__.js
- package.json
- env.json
- WELCOME.md
- README.md

At this point, there's a "hello world" function that's been automatically created (__main__.js). Autocode comes paired with a simple lib command for testing your functions locally and running them in the cloud. To test your function:

$ lib .
"hello world"

If we examine the functions/__main__.js file, we see the following:

/**
* A basic Hello World function
* @param {string} name Who you're saying hello to
* @returns {string}
*/
module.exports = async (name = 'world', context) => {
  return `hello ${name}`;
};

We can pass parameters to it using the CLI by specifying named parameters:

$ lib . --name "dolores abernathy"
"hello dolores abernathy"

Note that context is a magic parameter (automatically populated with execution details, when provided) as is callback (terminates execution), so these don't need to be documented and can not be specified as parameters when executing the function.

Pushing to the cloud

To push your function to a development environment in the cloud...

$ lib up dev
$ lib your_username.your_service[@dev]
"hello world"

And to release it (when you're ready!)

$ lib release
$ lib your_username.your_service
"hello world"

You can check out your service on the web, and use it in applications using our functions gateway, api.stdlib.com.

https://your_username.api.stdlib.com/your_service/

That's it! You haven't written a line of code yet, and you have mastery over building a service, testing it in a development (staging) environment online, and releasing it for private (or public) consumption.

Note: By default, APIs that you publish with lib release will have a documentation page in the Autocode public registry. You can keep your page private, as well as restrict execution access or add collaborators to your API, by modifying your API's permissions. For more information, see this docs page.

Another Note: Staging environments (like the one created with lib up dev) are mutable and can be replaced indefinitely. Releases (lib release) are immutable and can never be overwritten. However, any service can be torn down with lib down <environment> or lib down -r <version> (but releases can't be replaced once removed, to prevent mistakes and / or bad actors).

Connecting service endpoints

You'll notice that you can create more than one function per service. While you can structure your project however you'd like internally, it should also be noted that these functions have zero-latency access to each other. You can access them internally with the lib package on NPM, which behaves similarly to the lib command for testing. Use:

$ npm install lib --save

In your main service directory to add it, and use it like so:

functions/add.js

module.exports = async (a = 0, b = 0) => {
  return a + b;
};

functions/add_double.js

const lib = require('lib');

module.exports = async (a = 0, b = 0, context) => {
  let result = await lib[`${context.service.identifier}.add`]({a: a, b: b});
  return result * 2;
};

In this case, calling lib .add --a 1 --b 2 will return 3 and lib .add_double --a 1 --b 2 will return 6. The context magic parameter is used for its context.service.identifier property, which will return the string "your_username.your_service[@local]" in the case of local execution, "your_username.your_service[@ENV]" when deployed to an environment or release (where ENV is your environment name or semver).

Accessing your APIs from other applications

As mentioned in the previous section, you can use the NPM lib package that's available on GitHub and NPM to access your APIs from legacy Node.js applications and even the web browser. We'll have more SDKs coming out in the following months.

An existing app would call a function (username.bestTrekChar with version 0.2.1):

const lib = require('lib');

let result;

try {
  result = await lib.username.bestTrekChar['@0.2.1']({name: 'spock'});
} catch (err) {
  // handle error
}

// do something with result

Which would speak to your API...

module.exports = async (name = 'kirk') => {

  if (name === 'kirk') {
    return 'why, thank, you, too, kind';
  } else if (name === 'spock') {
    return 'i think this feeling is called "pleased"';
  } else {
    throw new Error('Only kirk and spock supported.');
  }

};

Accessing your APIs over HTTP

We definitely recommend using the lib library on NPM to make API calls as specified above, but you can also make HTTPS requests directly to the Autocode gateway. HTTP query parameters are mapped automatically to parameters by name.

https://username.api.stdlib.com/[email protected]/?name=BATMAN

Maps directly to:

/**
* Hello World
* @param {string} name
* @returns {string}
*/
module.exports = async (name = 'world') => {
  // returns "HELLO BATMAN" from above HTTP query
  return `Hello ${name}`;
};

Version control and package management

A quick note on version control - Autocode is not a replacement for normal git-based workflows, it is a supplement focused around service creation and execution.

You have unlimited access to any release (that hasn't been torn down) with lib download <serviceIdentifier> to download and unpack the tarball to a working directory.

Tarballs (and package contents) are closed-source. Nobody but you (and potentially your teammates) has access to these. It's up to you whether or not you share the guts of your service with others on GitHub or NPM.

As mentioned above: releases are immutable and can not be overwritten (but can be removed, just not replaced afterwards) and development / staging environments are mutable, you can overwrite them as much as you'd like.

Logging

Logging for services is enabled by default. When running a service locally with lib . or lib .functionname, all logs will be output in your console. The very last output (normally a JSON-compatible string) is the return value of the function.

To view remote logs (in dev or release environments), use the following syntax:

:: Lists all logs for the service
$ lib logs username.servicename

:: Lists main service endpoint logs for "dev" environment
$ lib logs username.servicename[@dev]

:: Lists service endpoint named "test" logs for "dev" environment
$ lib logs username.servicename[@dev].test

:: Lists all logs for "dev" environment
$ lib logs username.servicename[@dev]*
$ lib logs username.servicename[@dev].*

The default log type is stdout, though you can specify stderr with lib logs username.servicename -t stderr.

Limit the number of lines to show with the -l argument (or --lines).

Additional functionality

Autocode comes packed with a bunch of other goodies - as we roll out updates to the platform the serverless builds we're using may change. You can update your service to our latest build using lib rebuild. If for any reason your service goes down and is unrecoverable, you can fix it with this command.

To see a full list of commands available for the CLI tools, type:

$ lib help

We've conveniently copy-and-pasted the output here for you to peruse;

*
	-b                   Execute as a Background Function
	-d                   Specify debug mode (prints Gateway logs locally, response logs remotely)
	-i                   Specify information mode (prints tar packing and execution request progress)
	-t                   Specify an Identity Token to use manually
	-x                   Unauthenticated - Execute without a token (overrides active token and -t flag)
	--*                  all verbose flags converted to named keyword parameters

	Runs an Autocode function, i.e. "lib user.service[@env]" (remote) or "lib ." (local)

create [service]
	-n                   No login - don't require an internet connection
	-w                   Write over - overwrite the current directory contents
	--no-login           No login - don't require an internet connection
	--write-over         Write over - overwrite the current directory contents

	Creates a new (local) service

down [environment]
	-r                   Remove a release version (provide number)
	--release            Remove a release version (provide number)

	Removes Autocode package from registry and cloud environment

download [username/name OR username/name@env OR username/name@version]
	-w                   Write over - overwrite the target directory contents
	--write-over         Write over - overwrite the target directory contents

	Retrieves and extracts Autocode package

endpoints:create [name] [description] [param_1] [param_2] [...] [param_n]
	-n                   New directory: Create as a __main__.js file, with the name representing the directory
	--new                New directory: Create as a __main__.js file, with the name representing the directory

	Creates a new endpoint for a service

hostnames:add [source] [target]
	Adds a new hostname route from a source custom hostname to a target service you own.
	Accepts wildcards wrapped in curly braces ("{}") or "*" at the front of the hostname.

hostnames:list
	Displays created hostname routes from source custom hostnames to target services you own

hostnames:remove
	Removes a hostname route from a source custom hostname to a target service you own

http
	-p                   Port (default 8170)
	--port               Port (default 8170)

	Creates HTTP Server for Current Service

init [environment]
	-f                   Force command to overwrite existing workspace
	-n                   No login - don't require an internet connection
	--force              Force command to overwrite existing workspace
	--no-login           No login - don't require an internet connection

	Initializes Autocode workspace

login
	--email              E-mail
	--password           Password

	Logs in to Autocode

logout
	-f                   Force - clears information even if current Access Token invalid
	--force              Force - clears information even if current Access Token invalid

	Logs out of Autocode in this workspace

logs [service]
	-l                   The number of log lines you want to retrieve
	-t                   The log type you want to retrieve. Allowed values are "stdout" and "stderr".
	--lines              The number of log lines you want to retrieve
	--type               The log type you want to retrieve. Allowed values are "stdout" and "stderr".

	Retrieves logs for a given service

rebuild [environment]
	-r                   Rebuild a release package
	--release            Rebuild a release package

	Rebuilds a service (useful for registry performance updates), alias of `lib restart -b`

release
	Pushes release of Autocode package to registry and cloud (Alias of `lib up -r`)

tokens
	Selects an active Identity Token for API Authentication

tokens:add-to-env
	Sets STDLIB_SECRET_TOKEN in env.json "local" field to the value of an existing token

tokens:list
	-a                   All - show invalidated tokens as well
	-s                   Silent mode - do not display information
	--all                All - show invalidated tokens as well
	--silent             Silent mode - do not display information

	Lists your remotely generated Identity Tokens (Authentication)

up [environment]
	-f                   Force deploy
	-r                   Upload a release package
	--force              Force deploy
	--release            Upload a release package

	Pushes Autocode package to registry and cloud environment

user
	-s                   <key> <value> Sets a specified key-value pair
	--new-password       Sets a new password via a prompt
	--reset-password     <email> Sends a password reset request for the specified e-mail address
	--set                <key> <value> Sets a specified key-value pair

	Retrieves (and sets) current user information

version
	Returns currently installed version of Autocode command line tools

Upgrading from previous versions

If you're running a previous version and are having issues with the CLI, try cleaning up the old CLI binary links first;

$ rm /usr/local/bin/f
$ rm /usr/local/bin/lib
$ rm /usr/local/bin/stdlib

That's it!

Yep, it's really that easy. To keep up-to-date on developments, please star us here on GitHub, and sign up a user account for the registry. You can read more about service hosting and keep track of official updates on the official Autocode website, autocode.com.

Acknowledgements

Autocode is a product of and © 2021 Polybit Inc.

We'd love for you to pay attention to @AutocodeHQ and what we're building next! If you'd consider joining the team, shoot us an e-mail.

You can also follow our team on Twitter:

Issues encouraged, PRs welcome, and we're happy to have you on board! Enjoy and happy building :)

Thanks

Special thanks to the people and companies that have believed in and supported our vision and development over the years.

... and many more!

cli's People

Contributors

aboglioli avatar dtinth avatar fraxedas avatar jacoblee93 avatar jhult avatar keithwhor avatar louislarry avatar michaelrambeau avatar nemo avatar notoriaga avatar oehc avatar unional avatar watilde avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cli's Issues

I've tried to setup twice but get this error

$ lib init

/home/ubuntu/.nvm/versions/node/v4.7.3/lib/node_modules/lib.cli/cli/commands/nomethod.js:96
lib({token: token, host: host, port: port})[params.name](...args, kwargs, cb);
^^^

SyntaxError: Unexpected token ...
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at /home/ubuntu/.nvm/versions/node/v4.7.3/lib/node_modules/lib.cli/node_modules/cmnd/lib/command_line_interface.js:97:20
at Array.forEach (native)
at CommandLineInterface.load (/home/ubuntu/.nvm/versions/node/v4.7.3/lib/node_modules/lib.cli/node_modules/cmnd/lib/command_line_interface.js:80:44)

Do you use AWS Lambda?

Hello team!

Just curious, are you using AWS Lambda underneath? If so, I saw that you were supporting Node 6, do you use a shim like in Apex to make Lambda support it?

CORS options not set when returning an error.

When a service function returns an error, the stdlib servers return that response as a code 400 in text/plain without adding proper CORS headers. This causes browser libraries to fail to correctly receive any error responses. The issue seems to be entirely server-side.


Consider the following function that returns an error in some situations:
(Code is running at http://pras.stdlib.com/happy@dev/)

function.json

{
  "name": "happy",
  "description": "Returns the string 'happy'.",
  "kwargs": { "happy": "Set this to true." }
}

index.js

module.exports = (params, callback) => {
  // Return an error if happy is not true.
  if (!params.kwargs.happy) {
    return callback(new Error('Happy must be set to "true".'));
  }
  callback(null, 'happy');
};

Let's call this function from browser using the f library:

// Load f.js in the HTML HEAD.
f('pras/happy@dev')({
  happy: false   // intentionally cause an error
}, (err, result) => {
  console.log(err);
  console.log(result);
});

What we see is that when happy is set to true, the stdlib servers return a response that includes an Access-Control-Allow-Origin clause, which makes the response interpretable by the browser.

Access-Control-Allow-Origin:*
Access-Control-Expose-Headers:Access-Control-Allow-Origin
Connection:keep-alive
Content-Length:54
Content-Type:application/json
Date:Tue, 18 Apr 2017 05:14:45 GMT
X-Stdlib-Environment:dev
X-Stdlib-Time:100

When happy is set to false, however, the server responds without these headers when it returns the error:

Connection:keep-alive
Content-Length:28
Content-Type:text/plain
Date:Tue, 18 Apr 2017 05:15:12 GMT
X-Stdlib-Environment:dev
X-Stdlib-Time:100

Without the header, the browser rejects the response entirely as a security violation:

XMLHttpRequest cannot load http://f.stdlib.com/pras/happy@dev. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3000' is therefore not allowed access. The response had HTTP status code 400.

which means that f loses the server's error message and returns a generic one instead:

Error: Could not run function.

How to setup local development without internet

I would like to serve f in my localhost 8080 environment without using stdlib gateway eg. offline.
Do I need to setup nodejs hosting/gateway/bridge myself and call f functions or there is something already done ?

does not give option to create or change

>  stdlib up dev
Invalid namespace: "maer007"
Namespace must follow these guidelines:
  - Three (3) characters or more
  - Begin with a letter
  - Contain only alphanumeric (or -) characters
  - End with a letter or number

Cannot pass negative number as a command line parameter value

I created a simple adder function:

module.exports = (params, callback) => {
    const x1 = Number(params.kwargs.x1);
    const x2 = Number(params.kwargs.x2);
    console.log(`x2 = ${x2}`);

    callback(null, x1 + x2);
};

I can't figure out how to pass negative numbers in as parameter values. Here's what I'm trying:

c:\> lib . --x1 3 --x2 -2

The resulting output is:

x2 = 0
3

lib appears to be interpreting -2 as another parameter rather than as a parameter value for x2. Do I need to escape the -2 value somehow?

Error: Cannot read property 'filename' of undefined

function runs fine locally but when I publish dev or release, I get an error.

f . => incubated cross-platform applications
f . 2 => mesh 24/7 programming, liberating orchestrated collaborative touchpoints

lib up dev

...
Functions available:

  antic/buzz@dev/buzz
    Function

      [0] iterations

f antic/buzz@dev/buzz

Error: Error: Cannot read property 'filename' of undefined
    at IncomingMessage.<anonymous> (/Users/antic/.nvm/versions/node/v6.9.1/lib/node_modules/lib/node_modules/f/lib/f.js:100:27)
    at emitNone (events.js:91:20)
    at IncomingMessage.emit (events.js:185:7)
    at endReadableNT (_stream_readable.js:974:12)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)

https://f.stdlib.com/antic/buzz

Error: Cannot read property 'filename' of undefined

lib init error on macOS Sierra

macOS 10.12.1
node v5.1.1 (latest with Homebrew)

$ lib init
/usr/local/lib/node_modules/lib/cli/error_log.js:8
    let details = err.details[k];
    ^^^

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode

Looks like ES6 issue, but I'm not sure where to declare use strict.

Where are all the services?

I'm interested in building and using services with f. But I can't find anywhere a list of already available examples. I would imagine there's a list of services that people have build or that you've built. Where is that list?

f:new throw a SyntaxError

My envs:

  • node -v: v5.5.0
  • stdlib.com version: v0.1.3

Error log:

$ stdlib f:new
/usr/local/lib/node_modules/stdlib.com/index.js:4
let host = 'f.stdlib.com';
^^^

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:387:25)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at Object.<anonymous> (/usr/local/lib/node_modules/stdlib.com/cli/commands/f.js:6:16)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)

f:list - A command to list the functions under a namespace

Would be nice to have a command like f:list to list all the functions under a namespace. I'm not sure if it should only list under your own namespaces, for privacy.

$ stdlib f:list txgruppi/dev
txgruppi/dev/hello
txgruppi/dev/anotherfunction

How to secure a "function" ?

I use webtask.io that's part of auth0 and they use bearer token thats passed in the header.

What are your plans securing a call to endpoint?

use case:

person logs in with twitter , needs to process something specific to him/her , web app makes a call on his behalf.

I am hoping it won't be too complicated with enough developer control.

cheers

Pasting password for new user creation

I expected:

  1. The password to be starred
  2. The password to be recognized

What happened:

  1. The password was shown without stars
  2. The password was not recognized
  3. A validation error said I need a password greater than 5 characters.

This was on Mac Chrome

Alexa template does not include request validation.

Amazon is no longer approving skills without request validation so it should be added to the template.

Where are the templates held? Possibly I could add support to it but I don't see anything related to Alexa in the lib cli.

Ability to use npm pkgs / what is the package.json for?

Hey there! I'm already diggin' this tool:
f james/twitter/hello sausage bacon eggs

When I saw package.json I thought I might be able to install packages from there by putting them in package.json, but that doesn't appear to be the case. If not, what should I be using package.json for?

Logging and monitoring

I can't seem to find any documentation on how logging and monitoring works with lib. Can someone point me in the right direction there?

`414 Request-URI Too Large` on stdlib service page instead of readme.md

After using lib release to push a new version of the readme file for my stdlib project, I see a 414 Nginx error when viewing the service at https://stdlib.com/services/brozeph/chess.

screen shot 2016-11-22 at 4 26 25 pm

The contents of my readme are as follows (it is quite verbose...):

Chess Board Service

This service exists to validate and track board movements and provide a valid set of moves (in Algebraic Notation) for the consumer. The underlying functionality is provided by the open source NPM module, chess.

Parameters

Keyword arguments

  • stateCode - this is the identifer for the board at the current state (this value is returned as stateCode after each move)
  • notation - the notation for the next move to apply to the board

Usage

When an initial request is made to the API with no keyword arguments specified (stateCode or notation), a new game will be created and a response is returned highlighting available moves for the white side to make. The stateCode returned in the response represents that board at that state (for a new game, this value of stateCode is cWFtVUExd0hFUFBhd2RDSzFMMUtZQT09).

In order to make a subsequent move, the stateCode of the game along with the appropriate notation value must be supplied to the service. This will return a response with a new stateCode that must be used in conjunction with the next move to continue to move pieces on the game's board.

All requests to the service will result in either the creation of a new game board or continuation of an existing game board. Each response will contain the following top-level properties (in a JSON payload):

  • stateCode - the identifier required to resume the game at the current state (this value changes after each move)
  • notations
    • { algebraic notation of move } (i.e. a4, Nf3, etc.)
      • src
        • file - the file where the piece that can be moved currently sits (a, b, c, d, e, f or g)
        • rank - the rank where the piece that can be moved currently sites (1, 2, 3, 4, 5, 6, 7 or 8)
        • piece
          • moveCount - a number representing the number of times the piece has been moved
          • side
            • name - a string indicating the color of the piece: white or black
          • type - a string indicating the type of the piece: pawn, bishop, knight, rook, queen or king
      • dest
        • file - the file where the piece that can be moved would move to (a, b, c, d, e, f or g)
        • rank - the rank where the piece that can be moved would move to (1, 2, 3, 4, 5, 6, 7 or 8)
        • piece
          • moveCount - a number representing the number of times the piece has been moved
          • side
            • name - a string indicating the color of the piece: white or black
          • type - a string indicating the type of the piece: pawn, bishop, knight, rook, queen or king
  • history - an array of objects with the following properties:
    • capturedPiece - if a piece was captured, it would be noted here
    • hashCode - the identifier of the board piece position after this move
    • algebraic - the algebraic notation of the move
    • promotion - true or false depending on whether the move resulted in a promotion of a piece
    • piece
      • moveCount - a number representing the number of times the piece has been moved
      • side
        • name - a string indicating the color of the piece: white or black
      • type - a string indicating the type of the piece: pawn, bishop, knight, rook, queen or king
    • prevFile - the previous file where the piece once lived prior to the move
    • prevRank - the previous rank where the piece once lived prior to the move
    • postFile - the file where the piece lives after the move
    • postRank - the rank where the piece lives after the move
  • squares - an array of objects with the following properties
    • file - a lower case letter value that notes the column of the chess board: a, b, c, d, e, f or g, h
    • rank - a number that notes the row of chess board: 1, 2, 3, 4, 5, 6, 7 or 8
    • piece - an object that represents the piece
      • moveCount - a number representing the number of times the piece has been moved
      • side
        • name - a string indicating the color of the piece: white or black
      • type - a string indicating the type of the piece: pawn, bishop, knight, rook, queen or king
  • state
    • check - true or false indicating whether or not a King on the board is in check
    • mate - true or false indicating whether or not a King on the board is in check mate
    • repetition - true or false indicating whether a 3 fold repetition has occurred on the board
    • stalemate - true or false indicating whether or not the board is in stalemate

Command line

Each call returns a JSON payload that provides insight into available moves (notations), the history of moves to this point (history), each square on the board (squares), the current state of the game (state) and an identifier necessary for making the next move (stateCode).

f brozeph/chess/game --stateCode "anBwRVB3RkdxVXR0L00wN3JFTmV2UT09OmIz" --notation a5

The above command returns the following:

{
  "stateCode": "dlNRWDhtalVSaUpiVnFWVnQzVDNndz09OmIzOmE1",
  "notations": {
    "Na3": {
      "src": {
        "file": "b",
        "rank": 1,
        "piece": {
          "moveCount": 0,
          "side": {
            "name": "white"
          },
          "type": "knight",
          "notation": "N"
        }
      },
      "dest": {
        "file": "a",
        "rank": 3,
        "piece": null
      }
    },
    "Nc3": {
      "src": {
        "file": "b",
        "rank": 1,
        "piece": {
          "moveCount": 0,
          "side": {
            "name": "white"
          },
          "type": "knight",
          "notation": "N"
        }
      },
      "dest": {
        "file": "c",
        "rank": 3,
        "piece": null
      }
    },
    "Bb2": {
      "src": {
        "file": "c",
        "rank": 1,
        "piece": {
          "moveCount": 0,
          "side": {
            "name": "white"
          },
          "type": "bishop",
          "notation": "B"
        }
      },
      "dest": {
        "file": "b",
        "rank": 2,
        "piece": null
      }
    },
    "Ba3": {
      "src": {
        "file": "c",
        "rank": 1,
        "piece": {
          "moveCount": 0,
          "side": {
            "name": "white"
          },
          "type": "bishop",
          "notation": "B"
        }
      },
      "dest": {
        "file": "a",
        "rank": 3,
        "piece": null
      }
    },
    "Nf3": {
      "src": {
        "file": "g",
        "rank": 1,
        "piece": {
          "moveCount": 0,
          "side": {
            "name": "white"
          },
          "type": "knight",
          "notation": "N"
        }
      },
      "dest": {
        "file": "f",
        "rank": 3,
        "piece": null
      }
    },
    "Nh3": {
      "src": {
        "file": "g",
        "rank": 1,
        "piece": {
          "moveCount": 0,
          "side": {
            "name": "white"
          },
          "type": "knight",
          "notation": "N"
        }
      },
      "dest": {
        "file": "h",
        "rank": 3,
        "piece": null
      }
    },
    "a3": {
      "src": {
        "file": "a",
        "rank": 2,
        "piece": {
          "moveCount": 0,
          "side": {
            "name": "white"
          },
          "type": "pawn",
          "notation": ""
        }
      },
      "dest": {
        "file": "a",
        "rank": 3,
        "piece": null
      }
    },
    "a4": {
      "src": {
        "file": "a",
        "rank": 2,
        "piece": {
          "moveCount": 0,
          "side": {
            "name": "white"
          },
          "type": "pawn",
          "notation": ""
        }
      },
      "dest": {
        "file": "a",
        "rank": 4,
        "piece": null
      }
    },
    "c3": {
      "src": {
        "file": "c",
        "rank": 2,
        "piece": {
          "moveCount": 0,
          "side": {
            "name": "white"
          },
          "type": "pawn",
          "notation": ""
        }
      },
      "dest": {
        "file": "c",
        "rank": 3,
        "piece": null
      }
    },
    "c4": {
      "src": {
        "file": "c",
        "rank": 2,
        "piece": {
          "moveCount": 0,
          "side": {
            "name": "white"
          },
          "type": "pawn",
          "notation": ""
        }
      },
      "dest": {
        "file": "c",
        "rank": 4,
        "piece": null
      }
    },
    "d3": {
      "src": {
        "file": "d",
        "rank": 2,
        "piece": {
          "moveCount": 0,
          "side": {
            "name": "white"
          },
          "type": "pawn",
          "notation": ""
        }
      },
      "dest": {
        "file": "d",
        "rank": 3,
        "piece": null
      }
    },
    "d4": {
      "src": {
        "file": "d",
        "rank": 2,
        "piece": {
          "moveCount": 0,
          "side": {
          "name": "white"
          },
          "type": "pawn",
          "notation": ""
        }
      },
      "dest": {
        "file": "d",
        "rank": 4,
        "piece": null
      }
    },
    "e3": {
      "src": {
        "file": "e",
        "rank": 2,
        "piece": {
          "moveCount": 0,
          "side": {
            "name": "white"
          },
          "type": "pawn",
          "notation": ""
        }
      },
      "dest": {
        "file": "e",
        "rank": 3,
        "piece": null
      }
    },
    "e4": {
      "src": {
        "file": "e",
        "rank": 2,
        "piece": {
          "moveCount": 0,
          "side": {
            "name": "white"
          },
          "type": "pawn",
          "notation": ""
        }
      },
      "dest": {
        "file": "e",
        "rank": 4,
        "piece": null
      }
    },
    "f3": {
      "src": {
        "file": "f",
        "rank": 2,
        "piece": {
          "moveCount": 0,
          "side": {
            "name": "white"
          },
          "type": "pawn",
          "notation": ""
        }
      },
      "dest": {
        "file": "f",
        "rank": 3,
        "piece": null
      }
    },
    "f4": {
      "src": {
        "file": "f",
        "rank": 2,
        "piece": {
          "moveCount": 0,
          "side": {
            "name": "white"
          },
          "type": "pawn",
          "notation": ""
        }
      },
      "dest": {
        "file": "f",
        "rank": 4,
        "piece": null
      }
    },
    "g3": {
      "src": {
        "file": "g",
        "rank": 2,
        "piece": {
          "moveCount": 0,
          "side": {
            "name": "white"
          },
          "type": "pawn",
          "notation": ""
        }
      },
        "dest": {
        "file": "g",
        "rank": 3,
        "piece": null
      }
    },
    "g4": {
      "src": {
        "file": "g",
        "rank": 2,
        "piece": {
          "moveCount": 0,
          "side": {
            "name": "white"
          },
          "type": "pawn",
          "notation": ""
        }
      },
      "dest": {
        "file": "g",
        "rank": 4,
        "piece": null
      }
    },
    "h3": {
      "src": {
        "file": "h",
        "rank": 2,
        "piece": {
          "moveCount": 0,
          "side": {
            "name": "white"
          },
          "type": "pawn",
          "notation": ""
        }
      },
      "dest": {
        "file": "h",
        "rank": 3,
        "piece": null
      }
    },
    "h4": {
      "src": {
        "file": "h",
        "rank": 2,
        "piece": {
          "moveCount": 0,
          "side": {
            "name": "white"
          },
          "type": "pawn",
          "notation": ""
        }
      },
      "dest": {
        "file": "h",
        "rank": 4,
        "piece": null
      }
    },
    "b4": {
      "src": {
        "file": "b",
        "rank": 3,
        "piece": {
          "moveCount": 1,
          "side": {
            "name": "white"
          },
          "type": "pawn",
          "notation": ""
        }
      },
      "dest": {
        "file": "b",
        "rank": 4,
        "piece": null
      }
    }
  },
  "history": [
    {
      "capturedPiece": null,
      "hashCode": "jppEPwFGqUtt/M07rENevQ==",
      "algebraic": "b3",
      "promotion": false,
      "piece": {
        "moveCount": 1,
        "side": {
          "name": "white"
        },
        "type": "pawn",
        "notation": ""
      },
      "prevFile": "b",
      "prevRank": 2,
      "postFile": "b",
      "postRank": 3
    },
    {
      "capturedPiece": null,
      "hashCode": "vSQX8mjURiJbVqVVt3T3gw==",
      "algebraic": "a5",
      "promotion": false,
      "piece": {
        "moveCount": 1,
        "side": {
          "name": "black"
        },
        "type": "pawn",
        "notation": ""
      },
      "prevFile": "a",
      "prevRank": 7,
      "postFile": "a",
      "postRank": 5
    }
  ],
  "squares": [
    {
      "file": "a",
      "rank": 1,
      "piece": {
        "moveCount": 0,
        "side": {
          "name": "white"
        },
        "type": "rook",
        "notation": "R"
      }
    },
    {
      "file": "b",
      "rank": 1,
      "piece": {
        "moveCount": 0,
        "side": {
          "name": "white"
        },
        "type": "knight",
        "notation": "N"
      }
    },
    {
      "file": "c",
      "rank": 1,
      "piece": {
        "moveCount": 0,
        "side": {
          "name": "white"
        },
        "type": "bishop",
        "notation": "B"
      }
    },
    {
      "file": "d",
      "rank": 1,
      "piece": {
        "moveCount": 0,
        "side": {
          "name": "white"
        },
        "type": "queen",
        "notation": "Q"
      }
    },
    {
      "file": "e",
      "rank": 1,
      "piece": {
        "moveCount": 0,
        "side": {
          "name": "white"
        },
        "type": "king",
        "notation": "K"
      }
    },
    {
      "file": "f",
      "rank": 1,
      "piece": {
        "moveCount": 0,
        "side": {
          "name": "white"
        },
        "type": "bishop",
        "notation": "B"
      }
    },
    {
      "file": "g",
      "rank": 1,
      "piece": {
        "moveCount": 0,
        "side": {
          "name": "white"
        },
        "type": "knight",
        "notation": "N"
      }
    },
    {
      "file": "h",
      "rank": 1,
      "piece": {
        "moveCount": 0,
        "side": {
          "name": "white"
        },
        "type": "rook",
        "notation": "R"
      }
    },
    {
      "file": "a",
      "rank": 2,
      "piece": {
        "moveCount": 0,
        "side": {
          "name": "white"
        },
        "type": "pawn",
        "notation": ""
      }
    },
    {
      "file": "b",
      "rank": 2,
      "piece": null
    },
    {
      "file": "c",
      "rank": 2,
      "piece": {
        "moveCount": 0,
        "side": {
          "name": "white"
        },
        "type": "pawn",
        "notation": ""
      }
    },
    {
      "file": "d",
      "rank": 2,
      "piece": {
        "moveCount": 0,
        "side": {
          "name": "white"
        },
        "type": "pawn",
        "notation": ""
      }
    },
    {
      "file": "e",
      "rank": 2,
      "piece": {
        "moveCount": 0,
        "side": {
          "name": "white"
        },
        "type": "pawn",
        "notation": ""
      }
    },
    {
      "file": "f",
      "rank": 2,
      "piece": {
        "moveCount": 0,
        "side": {
          "name": "white"
        },
        "type": "pawn",
        "notation": ""
      }
    },
    {
      "file": "g",
      "rank": 2,
      "piece": {
        "moveCount": 0,
        "side": {
          "name": "white"
        },
        "type": "pawn",
        "notation": ""
      }
    },
    {
      "file": "h",
      "rank": 2,
      "piece": {
        "moveCount": 0,
        "side": {
          "name": "white"
        },
        "type": "pawn",
        "notation": ""
      }
    },
    {
      "file": "a",
      "rank": 3,
      "piece": null
    },
    {
      "file": "b",
      "rank": 3,
      "piece": {
        "moveCount": 1,
        "side": {
          "name": "white"
        },
        "type": "pawn",
        "notation": ""
      }
    },
    {
      "file": "c",
      "rank": 3,
      "piece": null
    },
    {
      "file": "d",
      "rank": 3,
      "piece": null
    },
    {
      "file": "e",
      "rank": 3,
      "piece": null
    },
    {
      "file": "f",
      "rank": 3,
      "piece": null
    },
    {
      "file": "g",
      "rank": 3,
      "piece": null
    },
    {
      "file": "h",
      "rank": 3,
      "piece": null
    },
    {
      "file": "a",
      "rank": 4,
      "piece": null
    },
    {
      "file": "b",
      "rank": 4,
      "piece": null
    },
    {
      "file": "c",
      "rank": 4,
      "piece": null
    },
    {
      "file": "d",
      "rank": 4,
      "piece": null
    },
    {
      "file": "e",
      "rank": 4,
      "piece": null
    },
    {
      "file": "f",
      "rank": 4,
      "piece": null
    },
    {
      "file": "g",
      "rank": 4,
      "piece": null
    },
    {
      "file": "h",
      "rank": 4,
      "piece": null
    },
    {
      "file": "a",
      "rank": 5,
      "piece": {
        "moveCount": 1,
        "side": {
          "name": "black"
        },
        "type": "pawn",
        "notation": ""
      }
    },
    {
      "file": "b",
      "rank": 5,
      "piece": null
    },
    {
      "file": "c",
      "rank": 5,
      "piece": null
    },
    {
      "file": "d",
      "rank": 5,
      "piece": null
    },
    {
      "file": "e",
      "rank": 5,
      "piece": null
    },
    {
      "file": "f",
      "rank": 5,
      "piece": null
    },
    {
      "file": "g",
      "rank": 5,
      "piece": null
    },
    {
      "file": "h",
      "rank": 5,
      "piece": null
    },
    {
      "file": "a",
      "rank": 6,
      "piece": null
    },
    {
      "file": "b",
      "rank": 6,
      "piece": null
    },
    {
      "file": "c",
      "rank": 6,
      "piece": null
    },
    {
      "file": "d",
      "rank": 6,
      "piece": null
    },
    {
      "file": "e",
      "rank": 6,
      "piece": null
    },
    {
      "file": "f",
      "rank": 6,
      "piece": null
    },
    {
      "file": "g",
      "rank": 6,
      "piece": null
    },
    {
      "file": "h",
      "rank": 6,
      "piece": null
    },
    {
      "file": "a",
      "rank": 7,
      "piece": null
    },
    {
      "file": "b",
      "rank": 7,
      "piece": {
        "moveCount": 0,
        "side": {
          "name": "black"
        },
        "type": "pawn",
        "notation": ""
      }
    },
    {
      "file": "c",
      "rank": 7,
      "piece": {
        "moveCount": 0,
        "side": {
          "name": "black"
        },
        "type": "pawn",
        "notation": ""
      }
    },
    {
      "file": "d",
      "rank": 7,
      "piece": {
        "moveCount": 0,
        "side": {
          "name": "black"
        },
        "type": "pawn",
        "notation": ""
      }
    },
    {
      "file": "e",
      "rank": 7,
      "piece": {
        "moveCount": 0,
        "side": {
          "name": "black"
        },
        "type": "pawn",
        "notation": ""
      }
    },
    {
      "file": "f",
      "rank": 7,
      "piece": {
        "moveCount": 0,
        "side": {
          "name": "black"
        },
        "type": "pawn",
        "notation": ""
      }
    },
    {
      "file": "g",
      "rank": 7,
      "piece": {
        "moveCount": 0,
        "side": {
          "name": "black"
        },
        "type": "pawn",
        "notation": ""
      }
    },
    {
      "file": "h",
      "rank": 7,
      "piece": {
        "moveCount": 0,
        "side": {
          "name": "black"
        },
        "type": "pawn",
        "notation": ""
      }
    },
    {
      "file": "a",
      "rank": 8,
      "piece": {
        "moveCount": 0,
        "side": {
          "name": "black"
        },
        "type": "rook",
        "notation": "R"
      }
    },
    {
      "file": "b",
      "rank": 8,
      "piece": {
        "moveCount": 0,
        "side": {
          "name": "black"
        },
        "type": "knight",
        "notation": "N"
      }
    },
    {
      "file": "c",
      "rank": 8,
      "piece": {
        "moveCount": 0,
        "side": {
          "name": "black"
        },
        "type": "bishop",
        "notation": "B"
      }
    },
    {
      "file": "d",
      "rank": 8,
      "piece": {
        "moveCount": 0,
        "side": {
          "name": "black"
        },
        "type": "queen",
        "notation": "Q"
      }
    },
    {
      "file": "e",
      "rank": 8,
      "piece": {
        "moveCount": 0,
        "side": {
          "name": "black"
        },
        "type": "king",
        "notation": "K"
      }
    },
    {
      "file": "f",
      "rank": 8,
      "piece": {
        "moveCount": 0,
        "side": {
          "name": "black"
        },
        "type": "bishop",
        "notation": "B"
      }
    },
    {
      "file": "g",
      "rank": 8,
      "piece": {
        "moveCount": 0,
        "side": {
          "name": "black"
        },
        "type": "knight",
        "notation": "N"
      }
    },
    {
      "file": "h",
      "rank": 8,
      "piece": {
        "moveCount": 0,
        "side": {
          "name": "black"
        },
        "type": "rook",
        "notation": "R"
      }
    }
  ],
  "state": {
    "check": false,
    "mate": false,
    "repetition": false,
    "stalemate": false
  }
}

HTTP GET

To create a new game:

curl https://f.stdlib.com/brozeph/chess/game

To make a move:

curl https://f.stdlib.com/brozeph/chess/game?stateCode=anBwRVB3RkdxVXR0L00wN3JFTmV2UT09OmIz&notation=a5

Web and Node.js

Utilizing the f NPM module (npm install f --save):

const f = require('f');

f('brozeph/chess/game')({
  stateCode : 'anBwRVB3RkdxVXR0L00wN3JFTmV2UT09OmIz',
  notation : 'a5'
}, (err, response) => {
  // handle error or response...
});

Merging package.json

I'm not seeing my template dependencies getting merged in with the main app template's. Are there any known issues? Can you point me to the code that should be doing this?
I've had a hard time tracking it down but I'm going to take another wack at it this evening.

lib init error

I have no idea why I'm getting this error or how to debug it:
image

How to set account information

The cli or other website documentation should describe how to set such account information as full_name and twitter_id

2FA

Users should be able to set up two factor authentication to protect their accounts.

Installation issue due to "lib" executable name

When installing using npm i -g lib.cli on mac I got the following error:

npm ERR! Darwin 16.3.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "lib.cli" "-g"
npm ERR! node v6.3.1
npm ERR! npm  v3.10.3
npm ERR! path ../lib/node_modules/lib.cli/cli/bin.js
npm ERR! code EEXIST
npm ERR! errno -17
npm ERR! syscall symlink

npm ERR! EEXIST: file already exists, symlink '../lib/node_modules/lib.cli/cli/bin.js' -> '/usr/local/bin/lib'
npm ERR! File exists: ../lib/node_modules/lib.cli/cli/bin.js
npm ERR! Move it away, and try again.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/david/projects/npm-debug.log

I think that the name lib is to generic and this can happen on other machines as well

Error on `lib init`

I got this error. Looks probably because of node.js version, but how do I do for this?

 $ lib init
/Users/izumisy/.nvm/versions/node/v4.5.0/lib/node_modules/lib/cli/error_log.js:8
    let details = err.details[k];
    ^^^

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:373:25)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/Users/izumisy/.nvm/versions/node/v4.5.0/lib/node_modules/lib/cli/commands/login.js:6:18)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
 $ node --version
v4.5.0

Error: No parser found for extension ".json"

Error produced on two computers with the following operating systems:

  • MacOS Sierra (w/ latest updates)
  • Ubuntu 16.04

Each computer has the same version of Node/npm/lib.cli installed:

  • lib.cli v3.0.0-rc9
  • Node v7.10.0
  • npm v4.6.1

Details

  • I gave the tutorial on the Medium Slack Platform Blog (Build a “Serverless” Slack Bot in 9 Minutes with Node.js and StdLib) a try.
  • I was able to get as far as Minute 5: StdLib Service Creation when I ran into the error.
    • Running lib create -t slack worked as expected.
    • However, inside my slack-app directory, running
      lib .commands --command /hello --text hey there --channel general
      produced the error Error: No parser found for extension ".json".
  • Identical error on both operating systems.

Using Environment Variables to Deploy

I want to deploy my code to <stdlib> through TravisCI (or any CI service).

I would need to set the environment variables to do this because I have to set my user. I can do this using a build.sh script for example which can receive $USER and $PASSWD from outside, but it's insecure.

Is there any method to use an $ACCESS_TOKEN to Deploy?

Error: Could not install template alexa

When attempting to create a service based on the alexa template, I'm getting an error message.

  • OS = Win 10 Pro
  • Node = 6.9.5

Error:

lib create -t alexa --write-over

Awesome! Let's create a stdlib service!
We'll use the template alexa to proceed.

? Service Name alexa
Fetching template alexa...

Error: Could not install template alexa

"no env.json detected message" appears when invoking f from a different directory

When invoking a service using f (example: f thisdavej/test) from a different directory than my microservice directory, a warning message appears indicating that "no env.json detected".

I recognize the intent of this message; however, I think the most common use case for f will be users invoking f from the command line to utilize various microservices—and this error message will not be meaningful to them, and will be a distraction.

I'm thinking the error message only makes sense when invoking microservices on the local machine using f . and thus the message should not appear otherwise. If there are other contexts where it is useful, perhaps you could include a --verbose flag that could be used by developers for troubleshooting purposes to help guide and notify them that the env.json file could not be found.

--set password prompting for password

It would be nice if lib user --set password prompted for a password if one is not supplied on the command line. This would prevent the password from appearing in my shell history.

Change HTTP code in node.js

How to change the HTTP code in node function?

Example:

var requiredField = {
      statusCode: 422,
      body: 'CPF parameter is required'
};
callback(requiredField, null);

######

var redirectToSite = {
      statusCode: 302,
      body: 'www.uol.com.br'
};
callback(null, redirectToSite);

Can i help me?

Function Setup

Hi,

I'm trying to understand from the documentation what is the proper way to handle setup/initialization of a new function. For example: It needs to connect to an underlying service, which takes time and I want it to be done just once on init.
Maybe I missed it, but I can't find reference for that.
Is it possible?

Thanks,
DD.

How can I use node.js modules?

Hi, it might be a simple issue, but including dependencies in package.json just doesn't work for me. How can I do it? Thanks.

Request service via GET

Will it be possible to call my function via GET? Some apps, like podcasts agregators and rss readers, can only make get requests.

lib create: Error Bad Request

Hi,

i just fresh install the cli yarn global add lib.cli, log in & try to create a project, then get error:

/tmp/stdlib-workspace $ lib create t

Awesome! Let's create a stdlib service!

Error: Bad Request

where can i get detail error info, or enable the verbose mode?

stdlib f:compile fails

Is there any way to debug? I suppose timeout. I'm getting this response:
Error: Unexpected server response:

<html>
<head>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <style type="text/css">
    html, body, iframe { margin: 0; padding: 0; height: 100%; }
    iframe { display: block; width: 100%; border: none; }
  </style>
<title>Application Error</title>
</head>
<body>
  <iframe src="//s3.amazonaws.com/heroku_pages/error.html">
    <p>Application Error</p>
  </iframe>
</body>
</html>

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.