Bitcoinjs-lib: Proposal for standalone examples

Created on 21 Apr 2018  路  6Comments  路  Source: bitcoinjs/bitcoinjs-lib

Examples references in the repository point to test cases which could potentially act as a barrier to entry to someone that isn't familiar with how testing works.

I've been manually trying to examine each of these functions in standalone js files here

Examples logging outputs at certain places will help with understanding how the library works.

Would like to hear thoughts on preparing separate sample files for making it easier for people to adopt get started with using bitcoinjs library

how to / question / docs

All 6 comments

Somewhat agree! I'd say by now things that need tests are already tested.. we could possibly be a little more verbose in example scripts. could execute them during travis the same way we do tests, to make sure we haven't broken something.

could execute them during travis the same way we do tests, to make sure we haven't broken something.

That was the biggest benefit of the integration approach.
Is there a simple dependency that will test the code used in a README.md (or specified markdown file) that we could put in a docs/ directory for examples?

Maybe we could adopt a similar structure from ExpressJS examples

Or

We could use this to test the example code if we'll be embedding sample code in markdown

Thoughts on this ? @dcousens @afk11

I'd just run nodejs over every file in the directory and link to it from a markdown file. Often when I leave a code snippet in markdown, it goes out of date a week later :)

lol that's true
it makes sense
I'll add example files and make an index to reference them

Closing in faovur of #1051, and if any other new PR comes, I'll track it from there

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ishwarchandratiwari picture ishwarchandratiwari  路  3Comments

zhaozhiming picture zhaozhiming  路  3Comments

thrastarson picture thrastarson  路  3Comments

silence-may picture silence-may  路  3Comments

coingeek picture coingeek  路  4Comments