Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
react-npm-formatted-relative-date
Advanced tools
A React project for displaying date in relative format i.g. 1 day ago
Basic React app. This project just aim to display relative date.
import React,{Component} from 'react';
import ReactDOM from 'react-dom';
import FormattedRelativeDate from 'react-npm-formatted-relative-date';
class App extends Component {
constructor(props){
super(props);
}
render() {
let myDate = new Date(2016,6,25);
return(
<div>
<FormattedRelativeDate date={myDate} />
</div>
);
}
}
ReactDOM.render(<App />,document.querySelector('.container'));
This example would render: relative date i.e. 3 days ago into the container element on the page.
Clone the repo as a new project:
git clone https://github.com/lobdev/react-npm-formatted-relative-date.git <formatted-relative-date>
Start Server:
First you have to replace the lib/component/formatted-relative-date.js to server.js in package.json
cd formatted-relative-date
npm i
npm start
Run App:
npm start command automatically initiate browser at 3000 port
http:://localhost:3000
Run tests:
cd formatted-relative-date
npm i
npm test
Make sure you configure your editor/IDE to use:
.editorconfig
.eslintrc
FAQs
A React project for displaying date in relative format i.g. 1 day ago
The npm package react-npm-formatted-relative-date receives a total of 0 weekly downloads. As such, react-npm-formatted-relative-date popularity was classified as not popular.
We found that react-npm-formatted-relative-date demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.