GithubHelp home page GithubHelp logo

isabella232 / eth-list-merger Goto Github PK

View Code? Open in Web Editor NEW

This project forked from myetherwallet/eth-list-merger

0.0 0.0 0.0 251 KB

simple tool to merge ethereum list from different sources

License: MIT License

JavaScript 100.00%

eth-list-merger's Introduction

eth-list-merger

simple tool to merge ethereum list from different sources

To get started:

Clone the Repository (including the submodules):
git clone --recursive https://github.com/MyEtherWallet/eth-list-merger.git

Require ethListMerger.js and use the methods described below.

ethListMerger.js Static Methods: (These will not work if called as instance method following new EthListMerger() )

mergeToEtherWallet(etherWalletPath, ethereumListPath)
etherWalletPath -> the file path pointing to the content to merge into
ethereumListPath -> the file path for content to be merged from
Convienence method that encapsulates multiple steps to combine the two lists.
Writes a local file containing the merged contents using the supplied file name as a suffix.
mergeToEthereumLists(etherWalletPath, ethereumListPath)
ethereumListPath -> the file path pointing to the content to merge into
etherWalletPath -> the file path for content to be merged from
Convienence method that encapsulates multiple steps to combine the two lists.
Writes a local file containing the merged contents using the supplied file name as a suffix.
merge(mergeInto, mergeFrom, mergeOn, compareProcessor)
mergeInto -> the file path pointing to the content to merge into
mergeFrom -> the file path for content to be merged from
(Optional) mergeOn -> Property name on which to preform existence comparison for merge determination. Defaults to using the address field.
(Optional) compareProcessor -> function to act on the mergeOn value for comparison. Defaults to comparing with all lower case and with leading/trailing spaces trimmed.
Returns an array that contains the merged list.
getDifference(mergeInto, mergeFrom, mergeOn, compareProcessor)
mergeInto -> the file path pointing to the content to merge into
mergeFrom -> the file path for content to be merged from
(Optional) mergeOn -> Property name on which to preform existence comparison for merge determination. Defaults to using the address field.
(Optional) compareProcessor -> function to act on the mergeOn value for comparison. Defaults to comparing with all lower case and with leading/trailing spaces trimmed.
Returns an array that contains those entries not present in the main/base list.
toEtherWalletFormat(valArray)
valArray -> array of token entries to be formatted to conform to the format found in etherWallet token files.
returns an array containing the supplied content, but formatted to match that found in the etherWallet token files.
toEthereumListFormat
valArray -> array of token entries to be formatted to conform to the format found in Ethereum-List token files.
returns an array containing the supplied content, but formatted to match that found in the Ethereum-List token files.
toFile(filename, result)
Convience method to write merged result to file
filename -> the file name to use
result -> the merge results to write to the file.

See ethListMerge_example.js for some usage examples

eth-list-merger's People

Contributors

gamalielhere avatar kvhnuke avatar stevemieskoski avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.