{"id":19852983,"url":"https://github.com/ship-components/ship-components-truncate","last_synced_at":"2025-07-15T21:32:58.615Z","repository":{"id":34924379,"uuid":"191452052","full_name":"ship-components/ship-components-truncate","owner":"ship-components","description":"Truncating strings and text","archived":false,"fork":false,"pushed_at":"2023-01-03T23:57:10.000Z","size":2685,"stargazers_count":0,"open_issues_count":20,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-15T05:49:38.978Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/ship-components.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}},"created_at":"2019-06-11T21:23:27.000Z","updated_at":"2021-01-11T20:06:39.000Z","dependencies_parsed_at":"2023-01-15T10:45:13.308Z","dependency_job_id":null,"html_url":"https://github.com/ship-components/ship-components-truncate","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ship-components/ship-components-truncate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ship-components%2Fship-components-truncate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ship-components%2Fship-components-truncate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ship-components%2Fship-components-truncate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ship-components%2Fship-components-truncate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ship-components","download_url":"https://codeload.github.com/ship-components/ship-components-truncate/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ship-components%2Fship-components-truncate/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265424999,"owners_count":23762890,"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-11-12T14:05:06.528Z","updated_at":"2025-07-15T21:32:58.574Z","avatar_url":"https://github.com/ship-components.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ship-components-truncate\nExports a component that can be used for truncating string and text inputs (comments, descriptions, etc.)\n\n[![npm](https://img.shields.io/npm/v/ship-components-truncate.svg)](https://www.npmjs.com/package/ship-components-truncate)\n[![Build Status](http://img.shields.io/travis/ship-components/ship-components-truncate/master.svg?style=flat)](https://travis-ci.org/ship-components/ship-components-truncate)\n[![Coverage](http://img.shields.io/coveralls/ship-components/ship-components-truncate.svg?style=flat)](https://coveralls.io/github/ship-components/ship-components-truncate)\n\n### Install dependencies and modules\nTo get started, navigate to the root directory of the project and run the following command to install the packages with npm:\n\n```shell\n$ npm install\n```\n### Running\nAfter running the command above, run the following command in and navigate to http://localhost:8080.\n```shell\n$ npm run start\n```\n\nExamples can be found in the `examples/` folder.\n\n## Changelog\n\n- 0.1.5: Removed node deps, fixed security issue, removed extra white spaces\n- 0.1.3: Initial commit\n\n## Usage\n\n### ES6/JSX (Recommended)\nThe component is written using ES6/JSX therefore Babel is recommended to use it. The below example is based on using [webpack](http://webpack.github.io/) and [babel-loader](https://github.com/babel/babel-loader).\n```js\nimport React from 'react';\nimport Truncate from 'ship-components-truncate';\n\nexport default class ExampleClass extends React.Component {\n  constructor(props) {\n    super(props);\n  }\n\n  render() {\n    return (\n      \u003cdiv\u003e\n\t      \u003cTruncate\n\t       key=\"short-text\"\n\t       characterLimit={50}\n\t\t   text={\"some text...\"}\n\t\t   onClick={someFunction}\n\t       /\u003e\n      \u003c/div\u003e\n    );\n  }\n}\n```\n\nReplace the prop values with accordance to your expectations for user behavior.\n\n## License\nThe MIT License (MIT)\n\nCopyright (c) 2019\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fship-components%2Fship-components-truncate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fship-components%2Fship-components-truncate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fship-components%2Fship-components-truncate/lists"}