{"id":13619338,"url":"https://github.com/suvash/nepalify","last_synced_at":"2025-08-25T08:19:28.296Z","repository":{"id":6494942,"uuid":"7735364","full_name":"suvash/nepalify","owner":"suvash","description":"A JavaScript library that adds support for typing Unicode Nepali(नेपाली) input on HTML \u003cinput\u003e and \u003ctextarea\u003e. (both in romanized and traditional layout)","archived":false,"fork":false,"pushed_at":"2023-12-28T22:29:42.000Z","size":3965,"stargazers_count":49,"open_issues_count":4,"forks_count":14,"subscribers_count":8,"default_branch":"main","last_synced_at":"2024-12-03T01:08:25.381Z","etag":null,"topics":["browser","html","input","javascript","javascript-library","nepali","romanized","textarea","traditional","unicode","unicode-nepali"],"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/suvash.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2013-01-21T16:05:06.000Z","updated_at":"2024-11-26T03:36:57.000Z","dependencies_parsed_at":"2024-06-21T19:06:57.906Z","dependency_job_id":"d1f55a4c-df27-439d-90b6-63d8fcd1d10b","html_url":"https://github.com/suvash/nepalify","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suvash%2Fnepalify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suvash%2Fnepalify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suvash%2Fnepalify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/suvash%2Fnepalify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/suvash","download_url":"https://codeload.github.com/suvash/nepalify/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232193474,"owners_count":18486394,"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":["browser","html","input","javascript","javascript-library","nepali","romanized","textarea","traditional","unicode","unicode-nepali"],"created_at":"2024-08-01T21:00:38.581Z","updated_at":"2025-01-02T12:14:12.444Z","avatar_url":"https://github.com/suvash.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# Nepalify\n\n[![Build Status](https://github.com/suvash/nepalify/actions/workflows/.github/workflows/run-tests.yml/badge.svg)](https://github.com/suvash/nepalify/actions/workflows/run-tests.yml)\n\nA JavaScript library that adds support for typing Unicode Nepali(नेपाली) input on HTML `\u003cinput\u003e` and `\u003ctextarea\u003e` (using both traditional and romanized layouts).\n\n## Supported Browsers\n\nThis library has been tested to work most modern browsers, the oldest ones being Internet Explorer 9, 10 and 11. If you are running an even older browser, you might want to look into the [legacy version](#legacy-version).\n\n## Live Demo / Playground\n\nOfficial Demo : https://www.thapaliya.com/en/writings/practice-romanized-nepali-unicode-in-your-browser/\n\n### More Examples\n\nIf you've used Nepalify in a project and would like to include it in this list, feel free to reach out or open an issue.\n\n- [NID Pre-Enrollment System, Government of Nepal](https://enrollment.donidcr.gov.np/PreEnrollment/): On the NID New Enrollment Form\n- [Samajik/सामाजिक](http://samajik.glitch.me/): View the source at https://glitch.com/edit/#!/samajik\n\n\n## Installation\n\nNepalify is available in CommonJS2, ES6 as well as UMD formats for all different needs.  \nIt can be consumed directly via Unpkg CDN into your pages, or installed via NPM to include in your application bundle.\n\n### Unpkg CDN installation\n\nVia [Unpkg](https://unpkg.com/), you can directly use the bare url for the latest version.\n\n```html\n\u003cscript src=\"https://unpkg.com/nepalify\" /\u003e\n```\n\nOr, include the full fixed url.\n\n```html\n\u003cscript src=\"https://unpkg.com/nepalify@0.5.0/umd/nepalify.production.min.js\" /\u003e\n```\n\nAlso, add an input/textarea element with a unique id, if you want to follow along.\n\n```html\n\u003cinput id=\"unique-input\" /\u003e\n\u003ctextarea id=\"unique-textarea\"\u003e\u003c/textarea\u003e\n```\n\nOptionally the following attributes can be used on the elements above.\n\n```html\nautocomplete=\"off\" autocorrect=\"off\" autocapitalize=\"off\" spellcheck=\"false\"\n```\n\n### Via NPM\n\nThe library is available on NPM as `nepalify`.\n\n```bash\nnpm install nepalify\n```\nAfterwards, you can use CommonJS imports\n```javascript\nconst nepalify = require('nepalify');\n```\n\nOr, you can use ES6 imports\n```javascript\nimport nepalify from \"nepalify\";\n```\n\n## Documentation\n\nThe default exports from the library consists of a handful of functions, as explained below.\n\n### availableLayouts()\n\nThis method returns all available layouts, currently `romanized` and `traditional`. These layout names can be provided as options to other functions.\n\n```javascript\nconsole.log(nepalify.availableLayouts());\n// [\"romanized\", \"traditional\"]\n```\n\n### interceptElementByID(\"unique-id\")\n\nThis method allows the library code to intercept the keypress events on `\u003cinput\u003e` and `\u003ctextarea\u003e` html elements, given an `id` selector. This can only be used in a browser.\n\nThe argument to this function is the same as you'd provide to the standard `getElementById`\n\n```javascript\nvar inputEl = nepalify.interceptElementById(\"unique-input-1\");\nvar textareaEl = nepalify.interceptElementById(\"unique-textarea-1\");\n\n// Further options can be provided as a second argument\nconst options = {\n  layout: \"traditional\",\n  enable: false,\n};\nnepalify.interceptElementById(\"unique-input-2\", options);\n\n// When the options are not provided, the following defaults are used\nconst defaultOptions = {\n  layout: \"romanized\",\n  enable: true,\n};\n```\n\nAt this point, the library should already be intercepting the keypresses. Go ahead and give it a try.\n\nThe object returned by the function above has more methods that can be used to control the interception.\n\n#### isEnabled()\n\nReturns a boolean value indicating whether the interception is turned on or not.\n\n#### enable()\n\nEnable the interception on the element. Already done by default.\n\n#### disable()\n\nDisable the interception on the element. Useful for clean up or building toggle behaviour.\n\n\n### format(\"some-ascii-text\")\n\nThis method allows you to format the text to Unicode nepali. Also usable in Node or any other non-browser javascript code.\n\n```javascript\nvar text = \"kiMkr/tv/ybimuX/\";\nconsole.log(nepalify.format(text));\n// किंकर्तव्यबिमुढ्\n\n// Further options can be provided as a second argument\nvar text = \"asdfghjkl\";\nconst options = {\n  layout: \"traditional\",\n};\nconsole.log(nepalify.format(text, options));\n// बकमानजवपि\n\n// When the options are not provided, the following defaults are used\nconst defaultOptions = {\n  layout: \"romanized\",\n};\n```\n\n## Development\n\nWhile the library is intended to run in the browser, you'll need to have `node` (and `npm`) installed locally for development.\n\nMost of the npm targets are explained in the `package.json` file itself. The following flow is preferred for contribution.\n\n- `npm install` for installing all the dependencies.\n- `npm run test` for running the test suite.\n- `npm run dev` to run a local server, serves an html page with the library injected for manual testing.\n- `npm run format` to format all the changes before making a PR.\n\n## Changelog\n\nPlease check the [CHANGELOG.md](https://github.com/suvash/nepalify/blob/main/CHANGELOG.md) for details.\n\n## Contributors\n\nPlease check the [contribution graph](https://github.com/suvash/nepalify/graphs/contributors) graph for now.\n\n## Legacy version\n\nThe legacy version of this package supported ancient browsers such as IE6, used jQuery as a dependency and relied on a bunch of hacks. It's still preserved on the [legacy-jquery branch](https://github.com/suvash/nepalify/tree/legacy-jquery)\n\n## License\n\nCopyright © 2020, Suvash Thapaliya\n\nDistributed under the [ISC License](https://github.com/suvash/nepalify/blob/main/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuvash%2Fnepalify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuvash%2Fnepalify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuvash%2Fnepalify/lists"}