{"id":17472758,"url":"https://github.com/shinnn/neat-frame","last_synced_at":"2026-05-05T20:34:22.742Z","repository":{"id":57309603,"uuid":"96883205","full_name":"shinnn/neat-frame","owner":"shinnn","description":"Generate simple framed text","archived":false,"fork":false,"pushed_at":"2019-04-18T11:41:40.000Z","size":68,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-04T04:17:57.290Z","etag":null,"topics":["border","frame","javascript","nodejs","padding","square","terminal"],"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/shinnn.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":"2017-07-11T10:52:03.000Z","updated_at":"2019-04-13T13:42:28.000Z","dependencies_parsed_at":"2022-09-01T11:32:01.788Z","dependency_job_id":null,"html_url":"https://github.com/shinnn/neat-frame","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/shinnn%2Fneat-frame","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shinnn%2Fneat-frame/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shinnn%2Fneat-frame/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shinnn%2Fneat-frame/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shinnn","download_url":"https://codeload.github.com/shinnn/neat-frame/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245991582,"owners_count":20706129,"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":["border","frame","javascript","nodejs","padding","square","terminal"],"created_at":"2024-10-18T17:35:44.089Z","updated_at":"2026-05-05T20:34:17.722Z","avatar_url":"https://github.com/shinnn.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# neat-frame\n\n[![npm version](https://img.shields.io/npm/v/neat-frame.svg)](https://www.npmjs.com/package/neat-frame)\n[![Build Status](https://travis-ci.org/shinnn/neat-frame.svg?branch=master)](https://travis-ci.org/shinnn/neat-frame)\n[![Coverage Status](https://img.shields.io/coveralls/shinnn/neat-frame.svg)](https://coveralls.io/github/shinnn/neat-frame?branch=master)\n\nGenerate simple framed text\n\n```javascript\nconst neatFrame = require('neat-frame');\n\nconsole.log(neatFrame(`neat-frame\nGenerate simple framed text from a string`));\n```\n\n```\n┌──────────────────────────────────────────────────────────────────────────┐\n│                                                                          │\n│ neat-frame                                                               │\n│ Generate simple framed text from a string                                │\n│                                                                          │\n└──────────────────────────────────────────────────────────────────────────┘\n```\n\n* No config, 1 simple beautiful output\n  * Single-line border\n  * 1 padding between text and borders\n  * 2 horizontal spaces on both side of the box\n  * Left-aligned text\n* Automatic box width adjustment for the current terminal width\n  * Even support for a non-TTY environment where [`process.stdout.columns`](https://nodejs.org/api/tty.html#tty_writestream_columns) is unavailable\n* Automatic line breaking for long text\n\n## Installation\n\n[Use npm.](https://docs.npmjs.com/cli/install)\n\n```\nnpm install neat-frame\n```\n\n## API\n\n```javascript\nconst neatFrame = require('neat-frame');\n```\n\n### neatFrame(*input*)\n\n*input*: `string`  \nReturn: `string`\n\n```javascript\n// When the terminal width is 30\n\nneatFrame('abcdefghijklmnopqrstuvwxyz');\n/* =\u003e\n  ┌────────────────────────┐\n  │                        │\n  │ abcdefghijklmnopqrstuv │\n  │ wxyz                   │\n  │                        │\n  └────────────────────────┘\n*/\n\n// When the terminal width is 20\n\nneatFrame('abcdefghijklmnopqrstuvwxyz');\n/* =\u003e\n  ┌──────────────┐\n  │              │\n  │ abcdefghijkl │\n  │ mnopqrstuvwx │\n  │ yz           │\n  │              │\n  └──────────────┘\n*/\n```\n\n## License\n\n[ISC License](./LICENSE) © 2017 Shinnosuke Watanabe\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshinnn%2Fneat-frame","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshinnn%2Fneat-frame","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshinnn%2Fneat-frame/lists"}