ENS Resolver that works in both ways (ENS name <--> Ethereum Address)
npm i -S ens-resolver
Resolver your ENS name or Ethereum Address ✨
Give it a try!
DEMO
Happy hacking =)
import React from "react";
import ReactDOM from "react-dom";
import EnsResolver from "ens-resolver";
// First one from ENS name to ETH address
// Second on from ETH address to ENS name
function App() {
return (
<div className="App">
<h1>Two ways ENS Resolver</h1>
<EnsResolver lookup="0xfb6916095ca1df60bb79ce92ce3ea74c37c5d359" ></EnsResolver>
{/*expected result: ethereumfoundation.eth */}
<EnsResolver lookup="ethereumfoundation.eth" ></EnsResolver>
{/*expected result: 0xfb6916095ca1df60bb79ce92ce3ea74c37c5d359 */}
</div>
);
}
npm run clean
- Remove lib/
directorynpm test
- Run tests with linting and coverage results.npm test:watch
- You can even re-run tests on file changes!npm test:prod
- Run tests with minified code.npm run test:examples
- Test written examples on pure JS for better understanding module usage.npm run lint
- Run ESlint with airbnb-confignpm run build
- Babel will transpile ES6 => ES5 and minify the code.npm run prepublish
- Hook for npm. Do all the checks before publishing your module.MIT © X5 Engine