# How to build an NPM module with package.json from the Kotlin/JS Gradle Plugin?

**URL:** <https://discuss.kotlinlang.org/t/how-to-build-an-npm-module-with-package-json-from-the-kotlin-js-gradle-plugin/14587>\
**Category:** JavaScript\
**Created:** [October 9, 2019, 2:31pm UTC](https://discuss.kotlinlang.org/t/how-to-build-an-npm-module-with-package-json-from-the-kotlin-js-gradle-plugin/14587 "2019-10-09T14:31:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lamba92](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/lamba92/32/5089_2.png) [@lamba92](https://discuss.kotlinlang.org/u/lamba92)\
**Post date:** [October 9, 2019, 2:31pm UTC](https://discuss.kotlinlang.org/t/how-to-build-an-npm-module-with-package-json-from-the-kotlin-js-gradle-plugin/14587/1 "2019-10-09T14:31:50Z")

</div>

> **Old post**
>
> I wrote a multi-platform project that works like a breeze in Android, JVM and Native. I’d like to build it as a JS library that is usable into a JS project. Unfortunately I have very little experience with the JS ecosystem so I never know if what the problem I’m facing is JS-related or not.
> 
> I’d like to export the compiled version in a single file with the `package.json` needed to import all it’s dependencies at compile-time for both Nodejs and browser (maybe 2 different builds?). If that is not the correct way of exporting a library, please show me how.
> 
> Is there any guide out there that I missed from Google?

I made some research and come to the conclusion that I just need to choose the right compilation type (and, umd or commons) and a package.json!

I noticed that the new Kotlin/JS plugin actually builds a package.json somewhere in the root project build directory.

Which task generates it and how I retrieve it without brutally copying it at the end of the build?

**Using Gradle MPP/JS plugin version 1.3.50**
