Logo
Explore Help
Sign In
fluencelabs/js-libp2p
1
0
Fork 0
You've already forked js-libp2p
mirror of https://github.com/fluencelabs/js-libp2p synced 2025-05-10 01:38:06 +00:00
Code Issues Projects Releases Wiki Activity
js-libp2p/scripts/update-version.js

15 lines
295 B
JavaScript
Raw Normal View History

feat: programmatically set agentVersion for use in identify (#1296) 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>
2022-07-15 16:35:52 +00:00
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}'
`
)
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.7 Page: 184ms Template: 4ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API