{"id":16731408,"url":"https://github.com/skratchdot/tojs","last_synced_at":"2026-04-12T23:43:05.706Z","repository":{"id":5351513,"uuid":"6537298","full_name":"skratchdot/tojs","owner":"skratchdot","description":"Convert files between plain text, javascript strings, and document.write() statements","archived":false,"fork":false,"pushed_at":"2013-10-04T00:21:56.000Z","size":157,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-14T12:12:52.567Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/skratchdot.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}},"created_at":"2012-11-05T00:31:44.000Z","updated_at":"2013-10-04T00:22:00.000Z","dependencies_parsed_at":"2022-08-06T18:01:37.218Z","dependency_job_id":null,"html_url":"https://github.com/skratchdot/tojs","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skratchdot%2Ftojs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skratchdot%2Ftojs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skratchdot%2Ftojs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skratchdot%2Ftojs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skratchdot","download_url":"https://codeload.github.com/skratchdot/tojs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243770285,"owners_count":20345276,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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-12T23:36:59.286Z","updated_at":"2025-10-18T19:37:05.784Z","avatar_url":"https://github.com/skratchdot.png","language":"JavaScript","readme":"# tojs #\n\n## Description ##\n\n**tojs** lets you convert files between plain text, javascript strings,\nand document.write() statements.\n\nIt's original purpose, was to read in an .html file, and output it\nas a series of document.write() statements. This is useful when creating\nbookmarklets.  You can code your .html page, then run **tojs** on it.\nNow all your bookmarklet has to do is include a script tag that points \nto the file you created with **tojs**.\n\nSince version 1.2.0, **tojs** was converted to a node.js project, and now\nsupports a few different input/output formats.  To see the new options,\ncheck out the **Usage** and **Options** sections below.\n\n\n## Usage ##\n\n    tojs [options] \u003cfiles\u003e\n\n\n## Options ##\n\n    -h, --help           output usage information\n    -v, --version        output the version number\n    -i, --input [type]   The type of input [plain|js|jsvar|docwrite]\n    -o, --output [type]  The type of input [plain|js|jsvar|docwrite]\n    -n, --name [name]    If output is \"jsvar\", this is the variable name\n    --oneline            Force output to be on one line only\n    --single-quotes      Use single-quotes instead of double-quotes for output\n    --no-var             var keyword will not be included in output\n    --no-open            document.open() will not be included in output\n    --no-close           document.close() will not be included in output\n\n\n## Examples ##\n\n    $ tojs one.txt two.txt three.txt\n    $ tojs -o \"docwrite\" file.html \u003e file.html.js\n    $ tojs -i \"docwrite\" -o \"plain\" file.html.js \u003e file.html\n    $ tojs -o \"jsvar\" --oneline --name \"myVariable\" file.txt\n    $ echo -e \"one\\ntwo\\nthree\" | tojs\n\n\n## Installation ##\n\n    npm install -g tojs\n\n\n## Links ##\n\n[Project Page](http://skratchdot.com/projects/tojs/)\n\n[Github Page](https://github.com/skratchdot/tojs/)\n\n\n## Version History ##\n\n### v1.2.2 (Released October 3, 2013)\n\n- fixed \"main\" declaration in package.json so library can be used from node\n  apps (patch submitted by [ryanramage](https://github.com/ryanramage))\n\n### v1.2.1 (Released January 2, 2012)\n\n- adding man page\n\n### v1.2.0 (Released December 27, 2012)\n\n- converting to a node.js project so installation instructions have changed\n\n- command line options have changed\n\n- now supports the following input/output types:\n\n  - plain\n  \n  - js\n  \n  - jsvar\n\n  - docwrite\n\n- can now pipe data from stdin or use a list of files as input (similar to the unix cat command)\n\n### v1.1.0 (Released November 5, 2012)\n\n- fixing formatting of help text\n\n- adding 2 new command line options\n\n  - **-o** | **--no-open** -- don't print the document.open() statement\n\n  - **-c** | **--no-close** -- don't print the document.close() statement\n\n### v1.0.0 (Released November 4, 2012)\n\n- Initial Release\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskratchdot%2Ftojs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskratchdot%2Ftojs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskratchdot%2Ftojs/lists"}