Template for setting up a project with JSDoc
Explore the docs
·
View Demo
·
Report Bug
·
Request Feature/Example
- Table of Contents
- About The Project
- Getting Started
- Usage
- References
- Documentation
- Contributing
- Want to hack on IPFS?
- Read the docs
- Look into other examples to learn how to spawn an IPFS node in Node.js and in the Browser
- Consult the Core API docs to see what you can do with an IPFS node
- Visit https://dweb-primer.ipfs.io to learn about IPFS and the concepts that underpin it
- Head over to https://proto.school to take interactive tutorials that cover core IPFS APIs
- Check out https://docs.ipfs.io for tips, how-tos and more
- See https://blog.ipfs.io for news and more
- Need help? Please ask 'How do I?' questions on https://discuss.ipfs.io
Make sure you have installed all of the following prerequisites on your development machine:
- Git - Download & Install Git. OSX and Linux machines typically have this already installed.
- Node.js - Download & Install Node.js and the npm package manager.
> npm install
> npm run test
Now open your console and check if has errors!
This example provides a template for setting up a JS project that utilizes type checker and js-ipfs
type declarations the were generated from JSDoc comments
Things should work out of the box, only requirement is to disable
skipLibCheck
because type declarations generated by typescript for commonjs modules raise some issues when consumed.
You can type check this example by running following in the example directory:
npm test
You should see following output:
> tsc --noEmit
If you remove // @ts-expect-error
comment is src/main.js
on line 16 and run npm test
once again you should see a following output instead:
> tsc --noEmit
src/main.js:16:14 - error TS2339: Property 'toUpperCase' does not exist on type 'CID'.
16 file.cid.toUpperCase()
~~~~~~~~~~~
Found 1 error.
In VSCode and other code editors that provide comparable IntelliSense features you should be able to get code auto complete, parameter and return value information for js-ipfs
APIs.
-
Things should work out of the box, with most
tsconfig
settings, however unlessskipLibCheck
is set totrue
many errors will be reported.That is because types are generated from source JSDoc comments and typescript seems to emit declarations which it then complains about.
-
Not all APIs are fully typed so you might observe gaps and
any
types here and there. We hope to improve this over time.
For more examples, please refer to the Documentation
- Documentation:
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the IPFS Project
- Create your Feature Branch (
git checkout -b feature/amazing-feature
) - Commit your Changes (
git commit -a -m 'feat: add some amazing feature'
) - Push to the Branch (
git push origin feature/amazing-feature
) - Open a Pull Request
The IPFS implementation in JavaScript needs your help! There are a few things you can do right now to help out:
Read the Code of Conduct and JavaScript Contributing Guidelines.
- Check out existing issues The issue list has many that are marked as 'help wanted' or 'difficulty:easy' which make great starting points for development, many of which can be tackled with no prior IPFS knowledge
- Look at the IPFS Roadmap This are the high priority items being worked on right now
- Perform code reviews More eyes will help a. speed the project along b. ensure quality, and c. reduce possible future bugs.
- Add tests. There can never be enough tests.
- Join the Weekly Core Implementations Call it's where everyone discusses what's going on with IPFS and what's next