https://github.com/mpetuska/npm-publish
Gradle plugin for NPM package publishing. Allows for arbitrary publishing as well as seamless integration with Kotlin JS/MPP plugins.
https://github.com/mpetuska/npm-publish
gradle-plugin kotlin kotlin-js npm
Last synced: about 1 month ago
JSON representation
Gradle plugin for NPM package publishing. Allows for arbitrary publishing as well as seamless integration with Kotlin JS/MPP plugins.
- Host: GitHub
- URL: https://github.com/mpetuska/npm-publish
- Owner: mpetuska
- License: other
- Created: 2020-12-27T10:46:04.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2025-02-19T10:00:33.000Z (3 months ago)
- Last Synced: 2025-03-28T21:06:07.507Z (about 1 month ago)
- Topics: gradle-plugin, kotlin, kotlin-js, npm
- Language: Kotlin
- Homepage: https://npm-publish.petuska.dev
- Size: 8.33 MB
- Stars: 130
- Watchers: 3
- Forks: 12
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
[](https://kotlinlang.slack.com/channels/npm-publish)
[](https://npm-publish.petuska.dev)
[](https://plugins.gradle.org/plugin/dev.petuska.npm.publish)
[](https://mvnrepository.com/artifact/dev.petuska/npm-publish-gradle-plugin/latest)# NPM-PUBLISH GRADLE PLUGIN
Gradle plugin enabling NPM publishing (essentially `maven-publish` for NPM packages). Integrates seamlessly with
Kotlin/JS/MPP plugin if applied, providing auto configurations.> Check the latest [release](https://github.com/mpetuska/npm-publish/releases/latest) for verified JVM, Kotlin and
> Gradle tooling versions## Setup
Here's a bare minimum setup when using together with one of the kotlin plugins. This setup would produce the following
tasks:* `assembleJsPackage`
* `packJsPackage`
* `publishJsPackageToNpmjsRegistry````kotlin title="build.gradle.kts"
plugins {
id("dev.petuska.npm.publish") version ""
kotlin("multiplatform") version ">" // Optional, also supports "js"
}kotlin {
js(IR) {
binaries.library()
browser() // or nodejs()
}
}npmPublish {
registries {
// For registries expecting an authentiation token, use authToken
register("npmjs") {
uri.set("https://registry.npmjs.org")
authToken.set("obfuscated")
}
// For registries expecting a username and password, use auth or username + password
register("nexus") {
uri.set("https://nexus.example.com/repository/npm-internal")
username.set("obfuscated")
password.set("obfuscated")
// Or:
// auth.set("base64-encoded-string")
}
}
}
```Full documentation can be found
on [npm-publish.petuska.dev](https://npm-publish.petuska.dev/latest/user-guide/quick-start/)## Contributing
See [CONTRIBUTING](.github/CONTRIBUTING.md)
Thanks to all the people who contributed to npm-publish!