mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-03-28 05:11:04 +00:00
If no `agentVersion` is provided for the Identify protocol, the default `AGENT_VERSION` will now be set to * `js-libp2p/<libp2p.version> UserAgent=<process.version>` when running in Node.js * `js-libp2p/<libp2p.version> UserAgent=<navigator.userAgent>` when running in the browser (also when running in a webworker) Fixes #686 Supersedes #1240 Co-authored-by: Kevin Westphal <westphal@consider-it.de> Co-authored-by: Kevin <56823591+6d7a@users.noreply.github.com>
15 lines
295 B
JavaScript
15 lines
295 B
JavaScript
import { readFile, writeFile } from 'fs/promises'
|
|
|
|
const pkg = JSON.parse(
|
|
await readFile(
|
|
new URL('../package.json', import.meta.url)
|
|
)
|
|
)
|
|
|
|
await writeFile(
|
|
new URL('../src/version.ts', import.meta.url),
|
|
`export const version = '${pkg.version}'
|
|
export const name = '${pkg.name}'
|
|
`
|
|
)
|