{"id":28633259,"url":"https://github.com/nickersoft/lconv","last_synced_at":"2025-06-12T15:08:04.218Z","repository":{"id":287653126,"uuid":"965400238","full_name":"Nickersoft/lconv","owner":"Nickersoft","description":"A tiny library for converting ISO-639 language codes","archived":false,"fork":false,"pushed_at":"2025-05-31T20:14:33.000Z","size":1493,"stargazers_count":0,"open_issues_count":8,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-01T08:09:39.038Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Nickersoft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2025-04-13T04:36:54.000Z","updated_at":"2025-04-13T21:15:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"4823ef5b-af16-42ce-bb7c-9e29914fbae1","html_url":"https://github.com/Nickersoft/lconv","commit_stats":null,"previous_names":["nickersoft/lconv"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Nickersoft/lconv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nickersoft%2Flconv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nickersoft%2Flconv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nickersoft%2Flconv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nickersoft%2Flconv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nickersoft","download_url":"https://codeload.github.com/Nickersoft/lconv/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nickersoft%2Flconv/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259490541,"owners_count":22865766,"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":"2025-06-12T15:08:03.483Z","updated_at":"2025-06-12T15:08:04.202Z","avatar_url":"https://github.com/Nickersoft.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lconv\nlconv is a tiny JavaScript module for converting between ISO 639 language codes, as well as ISO code resolution. \n\nSay, for example, you're looking up the Cantonese Language code `yue`, which only exists as an ISO 639-3 language code. Therefore, requesting the ISO 639-1 code for Cantonese would return `null`. *However,* Cantonese belongs to the Chinese macro-language, which *does* have an ISO 639-1 code. If we resolve the Cantonese language code to Chinese, then we'll get `zh` back instead of `null`. \n\nPretty neat, eh?\n\n## Using the API\n\nTo use lconv is extremely simple. Use it like this:\n\n```typescript\nimport { convert } from 'lconv';\n\nconvert('English', { from: 'label', to: 2 }); // ==\u003e eng\nconvert('eng', { from: 3, to: 1 }); // \nconvert('yue', { from: 3, to: 1, resolve: true }); // ==\u003e zh\n```\n\nYou can also retrieve language objects directly based on a string, optionally and explicitly specifying the format you're using:\n\n```typescript\nimport { getLanguage } from 'lconv';\n\ngetLanguage('English');\ngetLanguage(\"en\", 1);\n```\n\nThis will return all language codes and a human-readable language name, as well as language type and status.\n\n`convert` takes three options:\n\n- **from:** The ISO code of the given string. Can be either 1, 2, 3, or \"label\". If it is not provided it will be guessed.\n- **to:** The ISO code to convert to. Can be either 1, 2, 3, or \"label\". If it is not provided it will be guessed. \n- **resolve:** Boolean denoting whether to resolve language codes or not. By default this is set to \"false\".\n\n## Generating Data\n\nIf you do for some reason clone this repo, to generate the JSON data file needed for the module to run, just run:\n\n```bash\n$ pnpm run import\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnickersoft%2Flconv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnickersoft%2Flconv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnickersoft%2Flconv/lists"}