This question already has answers here:
Use of # symbol in Node module names [duplicate]
(5 answers)
Closed 4 years ago.
With the release of material-ui version 1, I noticed they have added an # symbol to the front of the library name #material-ui/core. After digging into my node modules, I see that they aren't the only one - I have #babel and #types as well.
Is the # significant for some reason, or is it just for the purposes of clarity and avoiding conflicts with previous versions of the library?
# indicates that the package is a scoped package. It is a way of grouping similar projects under single scope. A scoped package can be published as private as well as public. For more info check out the following link npm-scope
Related
This question already has answers here:
How is it possible to keep Rust module documentation in separate Markdown files?
(3 answers)
Closed 3 years ago.
If the readme Cargo.toml key is set, doc.rs renders the README on the crate's index page. Is there a way to emulate this when running cargo doc locally?
If I add:
#![doc = r###"contents
of
README.md
here
"###]
as a literal, I get the behaviour I'm looking for, but inlining a copy of my whole README.md is pretty inconvenient for making updates.
I tried:
#![doc = include!("README.md")]
but this gives an error:
error: unexpected token: `include`
--> src/lib.rs:3:10
|
3 | #![doc = include!("README.md")]
| ^^^^^^^
There is an unstable feature, external-doc, which enables this:
Example usage (nightly-only):
#![feature(external_doc)]
#![doc(include = "../README.md")]
Support for pyspatialite appears to have been overlooked for Python 3.x. The erstwhile replacement, sqlite3, is missing some critical functions such as UpdateLayerStatistics() and GeodesicLength().
The answer offered by #heibert here affirms that the installation package has not been updated for Python 3. That response is more than 4 years old, implying that support is not likely forthcoming.
There is a replacement package, sqlite3, but the queries with the aforementioned functions throw errors with that package imported.
What is the appropriate solution to install pyspatialite in Python 3? or
What are their renamed counterparts in sqlite3 (if they exist at all)? or
What is the proper package to access those and other functions previously available in pyspatialite?
The best response I found was by sandro here which explains both why pyspatialite is obsolete and what to do to overcome the issue.
This question already has answers here:
Do you need to use path.join in node.js?
(4 answers)
Closed 4 years ago.
I know that it is highly recommendable to use path.join if one would like to have his node project Windows compatible.
But do we need to use it also inside require commands? For example, instead of
const colors = require('colors/safe');
to use
const colors = require(path.join('colors', 'safe'));
The question may be a little silly, but I'm a bit lost after searching the require node documentation.
In the require statement the path.join is not necessary because these paths only resolved by node.js.
The path.join() method only joins strings together and use the OS specific delemiter.
https://nodejs.org/api/path.html#path_path_join_paths
Tip
If you want to pack your node.js application into an executable for example with pkg then it is recommended not using some join statements in require becuse this tool parse some statements to pack the required files into the executable.
I have a library coming up deep in the node module hierarchy which is causing security issues. I am not directly referencing that module in my package.json. One of the module which I reference is loading up another module and that module is loading this module. So it's the third layer in the dependency tree. I can find out the library dependence tree using npm ls.
I tried updating package.json, but that's not correct I think.
How can I update the version of this particular module without touching the top modules? Should I have to use shrinkwrap?
One (horrible way) (to answer your question directly) you could carefully manage all of those dependencies on your own and build that structure outside of NPM. I hate it. There is a ton of dependency management overhead and no guarantee any of the hand assembled components would work together - so testing overhead too. but in "theory" it could work. FWIW I don't think shrinkwrap helps with sub dependencies at all.
I recommend this course (I understand this isn't what you asked for - but it is the best approach IMO):
Fork/Branch the library and make the change there.
Then issue a pull request (Back to the main branch)
Until it is is merged back in, you cab reference it via the GIT url in your package.json
from: https://docs.npmjs.com/files/package.json
git+ssh://git#github.com:npm/npm.git#v1.0.27
git+ssh://git#github.com:npm/npm#semver:^5.0
git+https://isaacs#github.com/npm/npm.git
git://github.com/npm/npm.git#v1.0.27
I have recently come across a project that extensively uses cnpm for package managing. I saw something like
var a = require(#renil/a);
I have never seen something like this(#) in node when requiring a module.
Can anybody help me out
Those are actually two unrelated things. cnpm I had not heard of until I saw your question. After googling, it appears to be a Chinese maintained registry of node modules. Not sure what else is different but I'd probably stay away from it unless you know you need it.
The # symbol in a package name has to do with scoping related modules. That's well covered in the npm docs: https://docs.npmjs.com/misc/scope
These are scoped npm packages:
All npm packages have a name. Some package names also have a scope. A scope follows the usual rules for package names (url-safe characters, no leading dots or underscores). When used in package names, preceded by an #-symbol and followed by a slash, e.g.
#somescope/somepackagename
Scopes are a way of grouping related packages together, and also affect a few things about the way npm treats the package.