
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
@uiw/codemirror-theme-console
Advanced tools
One of the usages for react-codemirror is a logger component, but there is no theme with the required styles for achieving the desired feature. This theme is intended to be used when you want to have plain text in a console or terminal viewer.
npm install @uiw/codemirror-theme-console --save
import { EditorState } from '@codemirror/state';
import { javascript } from '@codemirror/lang-javascript';
import { consoleLight, consoleDark } from '@uiw/codemirror-theme-console';
const state = EditorState.create({
doc: 'my source code',
extensions: [consoleDark],
});
Using in React:
import { consoleLight, consoleLightInit, consoleDark, consoleDarkInit } from '@uiw/codemirror-theme-console';
// Or
import { consoleDark, consoleDarkInit } from '@uiw/codemirror-theme-console/dark';
import { consoleLight, consoleLightInit } from '@uiw/codemirror-theme-console/light';
<CodeMirror theme={consoleLight} />
<CodeMirror
theme={consoleLightInit({
settings: {
caret: '#c6c6c6',
fontFamily: 'monospace',
}
})}
/>
import { CreateThemeOptions } from '@uiw/codemirror-themes';
export declare const defaultSettingsConsoleLight: CreateThemeOptions['settings'];
export declare const consoleLightInit: (options?: Partial<CreateThemeOptions>) => import('@codemirror/state').Extension;
export declare const consoleLight: import('@codemirror/state').Extension;
export declare const defaultSettingsConsoleDark: CreateThemeOptions['settings'];
export declare const consoleDarkInit: (options?: Partial<CreateThemeOptions>) => import('@codemirror/state').Extension;
export declare const consoleDark: import('@codemirror/state').Extension;
import CodeMirror from '@uiw/react-codemirror';
import { consoleLight, consoleDark } from '@uiw/codemirror-theme-console';
import { javascript } from '@codemirror/lang-javascript';
function App() {
return (
<CodeMirror
value="INFO:waitress:Serving on http://0.0.0.0:5000"
height="200px"
theme={consoleLight}
onChange={(value, viewUpdate) => {
console.log('value:', value);
}}
/>
);
}
export default App;
import { EditorView } from '@codemirror/view';
import { EditorState } from '@codemirror/state';
import { javascript } from '@codemirror/lang-javascript';
import { consoleLight, consoleDark } from '@uiw/codemirror-theme-console';
const state = EditorState.create({
doc: 'my source code',
extensions: [consoleDark],
});
const view = new EditorView({
parent: document.querySelector('#editor'),
state,
});
As always, thanks to our amazing contributors!
Made with github-action-contributors.
Licensed under the MIT License.
FAQs
Theme console for CodeMirror.
We found that @uiw/codemirror-theme-console demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.