New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

use-string-diff

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

use-string-diff - npm Package Compare versions

Comparing version 1.4.5 to 1.4.6

2

package.json
{
"name": "use-string-diff",
"version": "1.4.5",
"version": "1.4.6",
"description": "custom react hook to get the difference between two strings",

@@ -5,0 +5,0 @@ "source": "src/index.ts",

@@ -11,4 +11,74 @@ <div align="center">

![Downloads](https://img.shields.io/npm/dm/use-string-diff?style=for-the-badge)
- [Installation](#installation)
- [Usage](#usage)
- [Issues](#issues)
- [🐛 Bugs](#-bugs)
- [💡 Feature requests](#-feature-requests)
- [LICENSE](#license)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
## Installation
This module is distributed via NPM which is bundled with NodeJS and
should be installed as one of your project's dependencies:
`npm install use-string-diff --save` or `yarn add use-string-diff`
## Usage
### Single Value
```
import { useStringDiff } from 'use-string-diff'
const MyComponent = () => {
const [state, setState] = useState('');
const difference = useStringDiff(value);
return (
<div>
<input
onChange={(event) => {
setState(event.target.value);
}}
value={value}
/>
</div>
)
}
```
### Two Values
```
import { useStringDiff } from 'use-string-diff'
const INITIAL_STRING = 'Initial String';
const MyComponent = () => {
const [state, setState] = useState(INITIAL_STRING);
const difference = useStringDiff(INITIAL_STRING, state);
return (
<div>
<input
onChange={(event) => {
setState(event.target.value);
}}
value={value}/>
</div>
)
}
```
### 🐛 Bugs
Please file an issue for bugs, missing documentation, or unexpected behavior.
## LICENSE
MIT
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc