{"id":19389367,"url":"https://github.com/kelvindev15/npm-gradle-plugin","last_synced_at":"2026-04-15T22:33:22.891Z","repository":{"id":247734140,"uuid":"824032823","full_name":"kelvindev15/npm-gradle-plugin","owner":"kelvindev15","description":"A Gradle Plugin to enhance npm build tool","archived":false,"fork":false,"pushed_at":"2026-04-13T21:36:57.000Z","size":772,"stargazers_count":0,"open_issues_count":26,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-13T23:29:09.848Z","etag":null,"topics":["build","build-automation","dependencies","gradle-plugin","node","npm","plugin","script"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kelvindev15.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-07-04T08:25:31.000Z","updated_at":"2025-06-30T07:43:47.000Z","dependencies_parsed_at":"2024-11-08T18:23:39.800Z","dependency_job_id":"94c21ed0-e2b5-466d-b0ef-d729e66f1ea0","html_url":"https://github.com/kelvindev15/npm-gradle-plugin","commit_stats":null,"previous_names":["kelvindev15/npm-gradle-plugin"],"tags_count":28,"template":false,"template_full_name":"DanySK/template-for-gradle-plugins","purl":"pkg:github/kelvindev15/npm-gradle-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kelvindev15%2Fnpm-gradle-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kelvindev15%2Fnpm-gradle-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kelvindev15%2Fnpm-gradle-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kelvindev15%2Fnpm-gradle-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kelvindev15","download_url":"https://codeload.github.com/kelvindev15/npm-gradle-plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kelvindev15%2Fnpm-gradle-plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31863492,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"ssl_error","status_checked_at":"2026-04-15T15:24:39.138Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["build","build-automation","dependencies","gradle-plugin","node","npm","plugin","script"],"created_at":"2024-11-10T10:16:04.162Z","updated_at":"2026-04-15T22:33:22.864Z","avatar_url":"https://github.com/kelvindev15.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Npm Gradle Plugin\n\nThis plugin is a wrapper over the npm cli script. The goal is to integrate the usage of npm within gradle so that devs can easily work node project while relying on the power of the gradle build tool.\n\n## How to use\n\nApply the plugin to your gradle project:\n\n```kotlin\nplugins {\n    id(\"io.github.kelvindev15.npm-gradle-plugin\") version \"\u003cversion\u003e\"\n}\n```\n\nDescribe how you would like your `package.json` to be. Here's an example:\n\n```kotlin\npackageJson {\n    author = \"Kelvin Olaiya\"\n    name = \"test-package\"\n    version = \"1.0.0\"\n    description = \"This is just a test package\"\n    main = \"index.js\"\n    license = \"MIT\"\n    scripts {\n        script(\"greet\" runs \"echo Hello, this is the greet script\")\n    }\n    dependencies {\n        \"express\" version \"^4.17.1\"\n    }\n    devDependencies {\n        \"nodemon\" version \"^2.0.7\"\n    }\n    repository = \"git\" to \"https://github.com/kelvindev15/npm-gradle-plugin\"\n    homepage = \"kelvin-olaiya.github.io\"\n}\n```\n\nNow you can run either one of the following tasks based on your need:\n\n* `generatePackageJson`: Generates a **package.json** file base on the provided configuration\n* `npmInstall`: runs the `npm install` command. (This task depends on the *generatePackageJson* task)\n* `generatePackageLock`: runs the `npm install --package-json-only` command. (This task depends on the *generatePackageJson* task)\n\nThe plugin also provide tasks for running npm scripts. \nBased on the previous example the `npmGreet` task will be created.\n\nIt is also possible to use an alternative syntax for defining the package.json configuration:\n\n```kotlin\npackageJson {\n    author = \"Kelvin Olaiya\"\n    name = \"test-package\"\n    version = \"1.0.0\"\n    description = \"Just a test\"\n    main = \"index.js\"\n    license = \"MIT\"\n    scripts {\n        script(\"test\" runs \"echo \\\"Error: no test specified\\\" \u0026\u0026 exit 1\")\n    }\n    dependencies {\n        \"express\" version \"^4.17.1\"\n    }\n    devDependencies {\n        \"nodemon\" version \"^2.0.7\"\n    }\n    repository = (\"git\" to \"https://github.com/kelvindev15/npm-gradle-plugin\")\n    homepage = \"kelvin-olaiya.github.io\"\n}\n```\n\nYou can also specify script dependencies:\n\n```kotlin\nscripts {\n    script(\"task1\" runs \"echo task1\")\n    script(\"task2\" runs \"echo task2\")\n    script(\"task3\" runs \"echo task3\" dependingOn listOf(npmScript(\"task1\"), npmScript(\"task2\")))\n    script(\"task4\" runs \"echo task4\" dependingOn listOf(npmScript(\"otherTask\") inProject \"other\"))\n    script(\"task5\" runs \"echo task5\" dependingOn listOf(npmScript(\"otherTask\", \"other\")))\n    script(\"task6\" runs \"echo task6\" dependingOn listOf(task(\"test\")))\n    script(\"task7\" runs \"echo task7\" dependingOn listOf(task(\"test\") inProject \"other\"))\n    script(\"task8\" runs \"echo task8\" dependingOn listOf(task(\"test\", \"other\")))\n}\n```\n\nIt is also possible to configure the task related to the scripts, for example for setting outputs and inputs:\n\n```kotlin\nscripts {\n    script(\"task1\" runs \"echo task1\") {\n        with(it) {\n            outputs.file(\"output.txt\")\n            inputs.file(\"input.txt\")\n        }\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkelvindev15%2Fnpm-gradle-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkelvindev15%2Fnpm-gradle-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkelvindev15%2Fnpm-gradle-plugin/lists"}