diff --git a/meta/classes-recipe/npm-update-dependencies.bbclass b/meta/classes-recipe/npm-update-dependencies.bbclass
new file mode 100644
index 0000000000..43b00b9b1b
--- /dev/null
+++ b/meta/classes-recipe/npm-update-dependencies.bbclass
@@ -0,0 +1,48 @@
+#
+# Copyright OpenEmbedded Contributors
+#
+# SPDX-License-Identifier: MIT
+#
+
+##
+## Purpose:
+## This class is used to update the list of npm dependencies in SRC_URI
+## by reading npm-shrinkwrap.json in the source tree. It writes one entry
+## with a checksum for each dependency, so that no fetcher has to read the
+## shrinkwrap file. npm.bbclass checks that SRC_URI matches the shrinkwrap
+## file.
+##
+## To perform the update: bitbake -c update_npm_deps recipe-name
+
+addtask do_update_npm_deps after do_patch
+do_update_npm_deps[nostamp] = "1"
+do_update_npm_deps[doc] = "Update the recipe by reading npm-shrinkwrap.json and write in ${THISDIR}/${BPN}-npm-deps.inc"
+
+RECIPE_UPGRADE_EXTRA_TASKS += "do_update_npm_deps"
+
+python do_update_npm_deps() {
+    import json
+    import oe.npm
+
+    shrinkwrap_file = d.expand("${S}/npm-shrinkwrap.json")
+    with open(shrinkwrap_file) as f:
+        shrinkwrap = json.load(f)
+
+    destdir = os.path.relpath(d.getVar("S"), d.getVar("UNPACKDIR"))
+    dev = bb.utils.to_boolean(d.getVar("NPM_INSTALL_DEV"), False)
+    try:
+        entries = oe.npm.shrinkwrap_src_uri(shrinkwrap, destdir, dev)
+    except ValueError as e:
+        bb.fatal("%s: %s" % (shrinkwrap_file, e))
+
+    lines = ["# Autogenerated with 'bitbake -c update_npm_deps %s'" % d.getVar("PN"), ""]
+    lines.append('SRC_URI += " \\')
+    lines.extend("    %s \\" % entry for entry in entries)
+    lines.append('"')
+
+    target_file = d.expand("${THISDIR}/${BPN}-npm-deps.inc")
+    with open(target_file, "w") as f:
+        f.write("\n".join(lines) + "\n")
+
+    bb.note("Successfully updated %d npm dependencies inside %s" % (len(entries), target_file))
+}
