How to use experimental features in React? - node.js

I'm trying to play with an experimental feature in React. Specifically react-call-return.
This is included as a package in React, but when installing latest from npm react-call-return is not included.
Is it possible to install this specific package from the repo with npm without having to clone the entire repo? The package does exist on npm but at the moment it isn't being used: react-call-return.
Any ideas on how to use this experimental feature?

Related

How to pin NPM package version in nested dependency

I'm new to NPM. I'm getting an alert from github dependabot saying my json-schema package is vulnerable. My current json-schema version is 0.2.3, it's required by my current npm#7.20.6 via transitive dependency on jsprim#1.4.1. I can't update my npm version right now since that involves lots of testing which I don't have time to do right now. Wondering what's a good way to force npm to use a newer version of json-schema. (0.4.0 is the version I should use.) I was thinking updating package-lock.json to use json-schema#0.2.3, but if I run npm install, that change will be erased right? Some examples would be appreciated!

Is there a way to save an NPM package that is no longer on NPM?

I am using a package that used to be available on NPM but since then it has been removed from NPM and GitHub.
I still have the package downloaded in my node_modules folder.
Is there a way to save that package and keep it in my node_modules? I am okay with maintaining the package myself.
It would also be great if I could sync just this specific package with Git so I can share it with my teammates.
You can use that package as a local module and install it as a package in your application.
Check this out: Local dependency in package.json

React - How to check which npm packages are not used on a project

I use CRA approach (create-react-app) using npm install installed different packages for my project, I don't use many of them but manually check which of these packages is not used on the project and then remove it will be a very difficult process, is there a way quickly check which packages are not used on my project and remove them?
You can check for any unused dependency or devdependency with depcheck package in any nodejs project. Use npx to use this package without installing it, run following command in terminal:
npx depcheck

Do I need node.js to use UglifyJs2?

I'm trying to use the command line tools of UglifyJs to minify my files. On the git page it says to download it using npm: npm install uglify-js -g.
Is that the only way to download it? My website doesn't use node.js so I'm wondering if there's an alternate way.
You can download it directly from it's github repo. However, I do agree with JohnnyHK it's better to install via npm as it will handle any dependancies required by UglifyJS.
When installing a module using npm -g, you're installing a command-line utility that uses node.js for its run-time rather than a module for a node.js based web site.
So it's still easiest to use npm to install it.

I don't know why the core modules in node js are not being recognized within my project using IntelliJ Idea (2016)

I keep getting the error: Cannot find module 'serve-favicon.' This error occurs not just for serve-favicon but for all core modules which also includes 'body-parser', 'cookie-parser', etc. I am using IntelliJ IDEA (version: 2016). I already enabled the Node.js Core library, and I have been able to use core modules in other projects successfully. What is different about this project however, is that I pulled it from github. Do I need to install another plugin? If yes, which one? Do I need to add another package?
serve-favicon, body-parser, cookie-parser are not node.js core modules.
You will need to install these dependencies from npm registry. To install these dependencies, you will need to run
npm install <package-name> --save
If you have pulled the project from github, chances are there will be a package.json file with a list of dependencies. In that case, all you need to do is run npm install from the project folder.

Resources