{"id":19852976,"url":"https://github.com/ship-components/ship-components-ago","last_synced_at":"2026-04-13T00:46:43.728Z","repository":{"id":34932846,"uuid":"191656473","full_name":"ship-components/ship-components-ago","owner":"ship-components","description":"Used for detecting time difference between posted snippet and present time","archived":false,"fork":false,"pushed_at":"2023-01-07T06:23:53.000Z","size":2736,"stargazers_count":0,"open_issues_count":24,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-24T20:38:12.593Z","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-12T23:09:44.000Z","updated_at":"2019-08-07T19:24:32.000Z","dependencies_parsed_at":"2023-01-15T10:41:19.121Z","dependency_job_id":null,"html_url":"https://github.com/ship-components/ship-components-ago","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ship-components%2Fship-components-ago","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ship-components%2Fship-components-ago/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ship-components%2Fship-components-ago/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ship-components%2Fship-components-ago/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ship-components","download_url":"https://codeload.github.com/ship-components/ship-components-ago/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241241841,"owners_count":19932828,"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:04.524Z","updated_at":"2026-04-13T00:46:43.664Z","avatar_url":"https://github.com/ship-components.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ship-components-ago\nExports a component that detects how long ago an element was created or made.\n\n[![npm](https://img.shields.io/npm/v/ship-components-ago.svg)](https://www.npmjs.com/package/ship-components-ago)\n[![Build Status](http://img.shields.io/travis/ship-components/ship-components-ago/master.svg?style=flat)](https://travis-ci.org/ship-components/ship-components-ago)\n\n### Overview\n\nThere are two formats for displaying the component. The normal format which does not take in the `twitter` property will show a longer version of time difference between when a snippet was posted versus the present time.\n\nUsing the `twitter` prop results in a smaller version. See the image below for examples.\n### Examples image\n\n![](https://i.imgur.com/iouCQUV.png)\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.2.1: Remove engines requirement\n- 0.2.0: Fixed package.json main path, added JA localization, and added second/minute examples.\n- 0.1.0: Added basic functionality, such as regarding twitter comment shortening.\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 Ago from 'ship-components-ago';\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      \u003cAgo\n           date={date}\n           twitter\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-ago","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fship-components%2Fship-components-ago","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fship-components%2Fship-components-ago/lists"}