
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
electrode-ui-config
Advanced tools
Makes the ui section from your app config available to your UI code. It works isomorphically.
npm install electrode-ui-config --save
To access the ui section from your app config, use electrode-ui-config.ui.
For example.
import Config from "electrode-ui-config";
export default class MyComponent extends React.Component {
render() {
if (Config.ui.doThis) {
return <This></This>
} else {
return <That></That>
}
}
}
This module provides the following utilities:
fullPath(path)
It will join config.ui.basePath with path to make a full UI route path.
Params
path - the path to join with basePathReturns
path is empty, then basePath is returned.fullApiPath(path)
Joins config.ui.basePath, config.ui.apiPath and path to make a full API route path.
basePath defaults to "", apiPath defaults to "/api".
Params
path - the path to join with basePath and apiPathReturns
path is empty, then /<basePath>/<apiPath> is returned.This package utilize a webpack feature which looks at the browser field in package.json and use that when bundling.
When running on server side, NodeJS require looks at the main field, which points to another file.
The client side simply uses window.config to retrieve the config values. Your application needs to be an Electrode app that uses electrode-server and electrode-react-webapp, which sends ui section from your app config to the browser in the Index template.
See electrode server configuration for details on setting up config files for your app.
Sample:
{
connections: {
...
},
plugins: {
...
},
ui: {
}
}
Occasionally apps or components need access to different config on server and client. To do this,
add a ssrUi property to the root level of the config object:
{
...
ssrUi {
foo: "ServerOnlyValue"
},
ui: {
foo: "ClientOnlyValue"
}
}
ssrUi properties will overwrite any matching properties defined in ui. Isomorphic code can use Config.ui and properties defined in both ssrUi and ui will only be available in the respective environments.
FAQs
Isomorphic UI config
The npm package electrode-ui-config receives a total of 108 weekly downloads. As such, electrode-ui-config popularity was classified as not popular.
We found that electrode-ui-config demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.