{"id":16864358,"url":"https://github.com/nickserv/final","last_synced_at":"2026-01-21T12:34:22.018Z","repository":{"id":57236114,"uuid":"42757260","full_name":"nickserv/final","owner":"nickserv","description":"A set of tools for writing JavaScript code once that runs on the command line, browser, and more.","archived":false,"fork":false,"pushed_at":"2023-03-01T05:31:05.000Z","size":405,"stargazers_count":1,"open_issues_count":25,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-24T04:44:39.989Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nickserv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"nickmccurdy"}},"created_at":"2015-09-19T03:02:14.000Z","updated_at":"2023-03-04T03:34:11.000Z","dependencies_parsed_at":"2024-08-02T11:59:22.391Z","dependency_job_id":"53e1ea38-5234-44b9-964e-86d1e713b850","html_url":"https://github.com/nickserv/final","commit_stats":null,"previous_names":["nicolasmccurdy/final","nickserv/final"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/nickserv/final","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickserv%2Ffinal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickserv%2Ffinal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickserv%2Ffinal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickserv%2Ffinal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nickserv","download_url":"https://codeload.github.com/nickserv/final/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nickserv%2Ffinal/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28632828,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T04:47:28.174Z","status":"ssl_error","status_checked_at":"2026-01-21T04:47:22.943Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T14:41:52.418Z","updated_at":"2026-01-21T12:34:22.000Z","avatar_url":"https://github.com/nickserv.png","language":"JavaScript","funding_links":["https://github.com/sponsors/nickmccurdy"],"categories":[],"sub_categories":[],"readme":"# Final\n[![npm version](https://badge.fury.io/js/final.svg)](https://badge.fury.io/js/final)\n[![Build Status](https://travis-ci.org/nicolasmccurdy/final.svg?branch=master)](https://travis-ci.org/nicolasmccurdy/final)\n[![Code Climate](https://codeclimate.com/github/nicolasmccurdy/final/badges/gpa.svg)](https://codeclimate.com/github/nicolasmccurdy/final)\n[![Test Coverage](https://codeclimate.com/github/nicolasmccurdy/final/badges/coverage.svg)](https://codeclimate.com/github/nicolasmccurdy/final/coverage)\n[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)\n\nA set of tools for writing JavaScript code once that runs on the command line, browser, and more.\n\n## Project Status\nFinal is in early (pre-1.0) development. It is usable, but its API may change frequently until it reaches 1.0. Additionally, several core features (and runners) have not been implemented yet.\n\n## Examples\nThe examples below can be run in a Node.js script or shell.\n\n### Getting Started\nFirst, create an instance of `Command` with a function implementing the `Command`'s core. Skip to the Usage section for more information about how to write `Command`s.\n```javascript\nvar adder = new final.Command(options =\u003e {\n  var first = parseInt(options.first, 10)\n  var second = parseInt(options.second, 10)\n\n  return first + second\n})\n```\nThis `Command` exposes a `run()` method which wraps the given core with some extra type conversion and validation. This is the recommended way of running `Command`s. Note that your core function should treat all options as `String`s, since all inputs and outputs are converted to and from `String`s by the `run()` method.\n```javascript\nvar result = adder.run({ first: 1, second: 2 }) // this returns a String\nconsole.log(result)\n```\n\n### API Runner\nFinal can generate callbacks for Node's `http.Server` class, allowing you to wrap `Command`s in web APIs. You can also embed `Command`s in larger Node web apps.\n```javascript\nnew final.API(adder).run()\n```\nHere, Final starts a web API at `localhost:3000` that wraps your `Command`. You can call it with HTTP requests like `GET localhost:3000?first=1\u0026second=2`, and you will get a plain text response with the result.\n\n### CLI Runner\nFinal can create command line interfaces around your `Command`.\n```javascript\nnew final.CLI(adder).run()\n```\nFinal will read arguments from the shell command running this JavaScript code, and\nthen it will immediately run the `Command` with the given options and print the\nresult to STDOUT. For example, try putting this in `add.js` and running\n`node add --first 1 --second 2` in the same directory.\n\n## Installation\n1. Install [Node.js](https://nodejs.org/en/) (version 6 or higher)\n2. `npm install --save final`\n3. `var final = require ('final')`\n\n## License\n[ISC](LICENSE) (it's similar to MIT, but simpler)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnickserv%2Ffinal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnickserv%2Ffinal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnickserv%2Ffinal/lists"}