angular-ipfs-service
v1.2.1
Published
<a href="https://github.com/ocknamo/angular-ipfs-service/actions?query=workflow%3Acode-validation-and-tests"> <img src="https://github.com/ocknamo/angular-ipfs-service/workflows/code-validation-and-tests/badge.svg"/> </a> <a href="https://codecov.io/gh/
Downloads
1
Readme
AngularIpfsService
Wrapper service of ipfs-core for Angular application.
This library was generated with Angular CLI version 11.1.1.
Installation
$ npm install angular-ipfs-service
Features
Start Ipfs node and inject to your application.
Methods
AngularIpfsService.start([options])
Start Ipfs node.
Returns
Promise<void>
options
AngularIpfsService.get()
Get Ipfs Instance.
Returns
Promise<IPFS>
API of IPFS
Application setting
custom-webpack setting
Using custom webpack config is recommened in order to provide more better node polyfills.
- Use @angular-builders/custom-webpack.
- Add config file as follow.
// extra-webpack.config.ts
import { Configuration, ProvidePlugin } from 'webpack';
import NodePolyfillPlugin from 'node-polyfill-webpack-plugin';
export default {
plugins: [
new NodePolyfillPlugin(),
new ProvidePlugin({
// eslint-disable-next-line @typescript-eslint/naming-convention
Buffer: ['buffer', 'Buffer'],
global: ['global'],
process: 'process/browser',
}),
],
} as Configuration;
tsconfig.json
- Sorry, "strict" mode is not supported now.
- Set the "skipLibCheck" to "true".
- Set the "allowSyntheticDefaultImports" to true.
- Set stream path to stream-browserify as follow.
"compilerOptions": {
"skipLibCheck": true,
"allowSyntheticDefaultImports": true,
"paths": {
"stream": [
"node_modules/stream-browserify"
]
}
}