Socket
Socket
Sign inDemoInstall

memoize-one

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

memoize-one - npm Package Compare versions

Comparing version 1.0.2 to 2.0.0

3

package.json
{
"name": "memoize-one",
"version": "1.0.2",
"version": "2.0.0",
"description": "A memoization library which only remembers the latest invocation",
"main": "lib/index.js",
"module": "src/index.js",
"author": "Alex Reardon <alexreardon@gmail.com>",

@@ -8,0 +7,0 @@ "license": "MIT",

@@ -88,2 +88,18 @@ # memoizeOne

## Module usage
### ES6 module
```js
import memoizeOne from 'memoize-one';
```
### CommonJS
If you are in a CommonJS environment (eg [Node](https://nodejs.org)), then **you will need add `.default` to your import**:
```js
const memoizeOne = require('memoize-one').default;
```
## `this`

@@ -126,9 +142,23 @@

## Performance :rocket:
## Code health
### Tiny
`memoizeOne` is super lightweight at `457 bytes` minified and `299 bytes` gzipped. (`1kb` = `1000 bytes`)
### Extremely fast
`memoizeOne` performs better or on par with than other popular memoization libraries for the purpose of remembering the latest invocation.
**Results**
- [simple arguments](https://www.measurethat.net/Benchmarks/ShowResult/4452)
- [complex arguments](https://www.measurethat.net/Benchmarks/ShowResult/4488)
The comparisions are not exhaustive and are primiarly to show that `memoizeOne` accomplishes remembering the latest invocation really fast. The benchmarks do not take into account the differences in feature sets, library sizes, parse time, and so on.
## Code health :thumbsup:
- Tested with all built in [JavaScript types](https://github.com/getify/You-Dont-Know-JS/blob/master/types%20%26%20grammar/ch1.md).
- 100% code coverage.
- [flow types](http://flowtype.org) for safer internal execution and external consumption. Also allows for editor autocompletion.
- Follows [Semantic versioning (2.0)](http://semver.org/) for safer versioning.
- Lightweight with no dependencies
- [100% code coverage](https://codecov.io/gh/alexreardon/memoize-one).
- [Continuous integration](https://travis-ci.org/alexreardon/memoize-one) to run tests and type checks.
- [`Flow` types](http://flowtype.org) for safer internal execution and external consumption. Also allows for editor autocompletion.
- Follows [Semantic versioning (2.0)](http://semver.org/) for safer consumption.
- No dependencies

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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