{"id":16736159,"url":"https://github.com/edloidas/autoresize","last_synced_at":"2025-04-10T12:21:29.726Z","repository":{"id":57187643,"uuid":"126224966","full_name":"edloidas/autoresize","owner":"edloidas","description":"Automatically resize the inputs","archived":false,"fork":false,"pushed_at":"2018-03-24T09:47:57.000Z","size":86,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T11:08:13.688Z","etag":null,"topics":["autoresize","input","performance","textarea","zero-dependency"],"latest_commit_sha":null,"homepage":null,"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/edloidas.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":"2018-03-21T18:41:31.000Z","updated_at":"2023-05-02T02:38:03.000Z","dependencies_parsed_at":"2022-08-28T13:00:29.592Z","dependency_job_id":null,"html_url":"https://github.com/edloidas/autoresize","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edloidas%2Fautoresize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edloidas%2Fautoresize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edloidas%2Fautoresize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edloidas%2Fautoresize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/edloidas","download_url":"https://codeload.github.com/edloidas/autoresize/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248217134,"owners_count":21066633,"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":["autoresize","input","performance","textarea","zero-dependency"],"created_at":"2024-10-13T00:08:30.902Z","updated_at":"2025-04-10T12:21:29.708Z","avatar_url":"https://github.com/edloidas.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"autoresize\n==========\n\n\u003e Automatically resize inputs. High performance. Zero dependencies.\n\n## Examples\n\nYou can try [TextArea](http://edloidas.github.io/autoresize/examples/textarea.html) or [Input](http://edloidas.github.io/autoresize/examples/input.html) examples in your browser.\u003cbr/\u003e\n__Note:__ _Autoresize of the `\u003cinput\u003e` element is **not yet implemented**._\n\n## Install\n\n#### Node\n\n```\nnpm i autoresize\n```\n\nThen in your project require it:\n\n```js\nconst autoresize = require('autoresize');\n```\nOr use ES import:\n```js\nimport autoresize from 'autoresize';\n```\n\n#### Browser\n\n__Note:__ _You will have access to the global `autoresize` function, that will be added to the `window` object._\n\n```html\n\u003cscript src=\"https://unpkg.com/autoresize/dist/autoresize.js\"\u003e\u003c/script\u003e\n```\n\nMinified version:\n\n```html\n\u003cscript src=\"https://unpkg.com/autoresize/dist/autoresize.min.js\"\u003e\u003c/script\u003e\n```\n\nES5 version:\n\n```html\n\u003cscript src=\"https://unpkg.com/autoresize/dist/autoresize.es5.js\"\u003e\u003c/script\u003e\n```\n\nMinified ES5 version:\n\n```html\n\u003cscript src=\"https://unpkg.com/autoresize/dist/autoresize.es5.min.js\"\u003e\u003c/script\u003e\n```\n\n## Usage\n\n```js\nconst element = document.querySelector('#textarea');\nconst options = { maximumRows: 5, assumeRendered: true };\n\n// Enable autoresize by adding specific listeners\nconst disable = autoresize(element, options);\n\n// Remove all listeners and disable autoresize\ndisable();\n```\n\n### Paramenters\n\n##### `element`\n\nAn HTML element of types: `HTMLTextAreaElement` or `HTMLInputElement`.\n\n##### `options`\n\n\nAn options object, that is different for each element type.\n\n__TextArea__\n```js\n{\n  minimumRows: 1,\n  maximumRows: Infinity,\n  rowHeight: null,\n  assumeRendered: false\n}\n```\nPassing the `rowHeight` value may be a bit more performant solution, but it will mean that the `lineSize` is guarantee to be unchanged in future with JS or CSS (including some `@media` queries). Otherwise, `rowHeight` will be calculated on the initial step and recalculated on window `'resize'` event.\n\nPassing the `assumeRendered` with `true` value will skip the check for the presence of the element in the DOM. Otherwise, the `render()` function will wait, until the element is rendered and then will apply the event listeners.\n\n__Input__\n```js\n{\n  maxWidth: null,\n  assumeRendered: false\n}\n```\n\n## License\n\n[MIT](LICENSE) © [Mikita Taukachou](https://edloidas.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedloidas%2Fautoresize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedloidas%2Fautoresize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedloidas%2Fautoresize/lists"}