How download package from unpkg or add in dependencies unpkg package? - reactjs

problem
I try install ipfs from unpkg site.
https://www.unpkg.com/browse/ipfs#0.36.3/
Project
It is React project.
But i can't download this package or install in package.json
Main page unpkg
On main page write this
unpkg is a fast, global content delivery network for everything on npm. Use it to quickly and easily load any file from any package using a URL like:
unpkg.com/:package#:version/:file
Solution
I try install
package.json
"ipfs": "unpkg.com/:ipfs#0.36.3"
module
import IPFS from 'https://unpkg.com/ipfs#0.36.3';
it is not work.
How can i download from unpkg page this package ?

As per documentation, you either need to install the package globally using following command
$ npm install -g ipfs
Or install ipfs-core as lighter package using following command.
$ npm install ipfs-core

Related

reactjs application add to existing reactjs application

I'm just starting out in Reactjs.
I have a RedHat Linux VM.
I've installed nodejs and created a simple reactjs application:
npx create-react-app my-first-project
My first project works OK.
Now I have found this great reactjs package with a demo:
https://github.com/TarikHuber/material-ui-filter
I want to install the demo part of this package that consists of index.css, index.html, app.js, index.js
How would I go with this?
Where do I put this new code relative to my-first-project?
How do I call this new code?
The package I think calls redux so I assume I will install this first.
Thanks.
You should learn how npm works. If you find some cool package and you want to use it then you have to install that package. There is a installation command on Readme file on that github repo. Install package via npm install material-ui-filter then you can just use the html file on demo project.

Where do the html, css and other files go after converting angular project to npm module and how is a project converted to npm module?

I want to customize ngx-material-timepicker node module by changing basic html and css of the project. But no html, css files are available in the node_modules-> ngx-material-timepicker folder only ts files are there.
So I forked it to my github repo and then after customizing it, I tried installing it to my angular project by using npm install mygitrepo.git --save but after this i cannot include the module to my angular project.
In a default npm install, the registry is set to https://registry.npmjs.org/. This is where npm will download packages from when you run npm install .
You can Modify the value of the repo location to a custom repo with the command npm set registry . After resetting the registry, npm will only fetch packages from instead.
But you may not want to change the registry entirely. You can also use a organization specific scope to place your packages to be fetched.
https://docs.npmjs.com/about-scopes
Here is a short blog on publishing a module in general. https://hackernoon.com/publish-your-own-npm-package-946b19df577e

How should I include aws-appsync in AngularJS project

I am working on a AngularJS project that uses bower as package manager and gulp to inject the dependencies into the index.html file. I am not very familiar with both of these tools.
I now want to use AWS AppSync, but it is not available as a bower package.
Currently the AWS SDK is specified as a file dependency in bower.json as:
"aws-sdk": "./thirdparty/script/aws-sdk-2.69.0.min.js",
When I install aws-appsync with npm npm install aws-appsync the node_modules folder for aws-appsync contains multiple js files in the lib directory.
How can I include these with bower or is there another way to do this altogether?
I am currently unable to change much of the build and dependency management process so any suggestions working with the current tools would be much appreciated.
Thanks for reaching out!
The Bower team itself has recommended that people migrate to npm or yarn, and so aws-appsync has not been pushed to Bower.
It might be worth investigating whether you can install directly from github using something like...
bower install <github url>.git
... and install directly from the appsync-sdk github repo.
In the end I hacked together an interim solution until I can move the whole project over to npm and browserify.
I added the aws-appsync package using npm and required it in a new file. This file is then passed through a gulp task that uses the browserify plugin. The added file is then included into the rest of the build process as before.

Can't create WebStorm React project

I'm trying to create a React project in WebStorm 2016.3.1
It's asking me for a create-react-app but I have no idea what that is and I can't find any reference on Google.
What is it and where can I find the value?
You need to install create-react-app npm module, before you use this feature.
npm install -g create-react-app
You can read more about this feature on the official release blog of WebStorm.
Excerpt from the documentation :
Make sure that you have create-react-app installed globally on your computer, for that run npm install -g create-react-app. Then to start your new project, double click on the start task in the npm tasks tool window to run it. That’s it!
I had ie installed create-react-app globally using yarn and webstorm failed to find it. Then I used npm, not to mention globally and its working like a charm.
TL;DRNo need to install anything. Just enter npx create-react-app in the create-react-app field & it should work like a pycharm, I mean charm :)
Side note: npx is pre-bundled with npm since npm version 5.2.0.
I created webStrom react app following this steps.
Download node.js
Open command line console and type "npm install -g create-react-app"
Create react app project from web-storm.
Make sure you provided the correct file path of create-react-app , by default it is
installed in ~\AppData\Roaming\npm\node_modules\create-react-app
use
npm start: to start development server
If you are using asdf or any other tool to manage multiple versions of nodejs, you will need to set up the path to create-react-app manually
I'm on mac, so for me the path was
/Users/<USER>/.asdf/installs/nodejs/12.16.2/.npm/lib/node_modules/create-react-app

Download persice i18n locale in Angularjs using Bower

I'm using Wiredep tool with Gulp, to inject into my index.html on the run everything that I install using Bower. I don't want to download all the files listed here.
Is there a way to download only precise locale?
I've tried
bower install angular-i18n/angular-locale_uk-ua.js
And I got
fatal: remote error:
Repository not found.
In order to do this angular/bower-angular-i18n repo should be forked.
If the concern is to lower bower_components footprint on server side, postinstall hook can be supplied in .bowerrc to delete extra files from the package after installation.

Resources