Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
mathkeyboardengine
Advanced tools
MathKeyboardEngine provides the logic - in JavaScript and LaTeX - for a highly customizable virtual math keyboard.
MathKeyboardEngine for JavaScript provides the logic for a highly customizable virtual math keyboard. It is intended for use together with any LaTeX typesetting library (for example MathJax or KaTeX).
Also available:
insert(someMatrixNode)
or moveUp()
, deleteLeft()
, etc.getEditModeLatex()
outputs the total of LaTeX you typed, for example \frac{3}{4}\blacksquare
(if \blacksquare
is your cursor), which you then feed to KaTeX or MathJax for display.getViewModeLatex()
outputs the LaTeX without a cursor.Note: you can use parseLatex(latexString)
for pre-filling the textbox or for allowing users to also use raw LaTeX commands.
Live examples can be tested at mathkeyboardengine.github.io.
Unique about MathKeyboardEngine:
StandardLeafNode
, StandardBranchingNode
, AscendingBranchingNode
and DescendingBranchingNode
can be used for almost all LaTeX, including fractions, powers, combinations, subscript, etc. with ready-to-use up/down/left/right navigation.A con:
More pros:
<script>
elementThere is no need to download or install anything. Your website just needs to have a <script>
element that results in getting one of the following files from jsDelivr:
esYEAR: those are JavaScript language versions.
esm: the ECMAScript module is simply the best choice: easy, safe, future proof.
iife: an immediately invoked function expression for browsers that do not support ESM.
For each of those ".js" files there is a minified version (".min.js") - a smaller file (of only 17 kB) with the same capabilities.
A <script>
element using the recommended "MathKeyboardEngine.es2017-esm.min.js":
<script type="module">
import * as mke from 'https://cdn.jsdelivr.net/npm/mathkeyboardengine@v1.1.1/dist/MathKeyboardEngine.es2017-esm.min.js';
let latexConfiguration = new mke.LatexConfiguration();
let keyboardMemory = new mke.KeyboardMemory();
// Subscribe to onclick events of virtual key presses, etc.
</script>
A <script>
element using the with-older-browsers-compatible "MathKeyboardEngine.es2015-iife.min.js":
<script src="https://cdn.jsdelivr.net/npm/mathkeyboardengine@v1.1.1/dist/MathKeyboardEngine.es2015-iife.min.js"></script>
<script type="text/javascript">
window.addEventListener('DOMContentLoaded', (event) => {
let latexConfiguration = new mke.LatexConfiguration();
let keyboardMemory = new mke.KeyboardMemory();
// Subscribe to onclick events of virtual key presses, etc.
});
</script>
Note: "mke" is an abbreviation of "MathKeyboardEngine". You can choose something different. (But the iife format forces you to use "mke".)
After opening a folder in VS Code, run this npm command in the terminal:
npm i mathkeyboardengine
Verify that mathkeyboardengine
has been added to the node_modules
folder. Then you can choose:
Using the CommonJS module (the .cjs
file) in myFile.js
:
const mke = require('mathkeyboardengine');
const k = new mke.KeyboardMemory();
Using the ESM module (the .mjs
file) in myFile.js
or myFile.ts
:
import * as mke from 'mathkeyboardengine';
const k = new mke.KeyboardMemory();
Note that a .d.ts
file is shipped since v0.2.1
(this lets your editor show the (TypeScript) types).
MathKeyboardEngine has also been published to Deno. For using the pure TypeScript files in Deno:
import * as mke from 'https://deno.land/x/mathkeyboardengine@v1.1.1/x.ts';
const k = new mke.KeyboardMemory();
Visit the documentation and (the right version of)* the examples folder for more implementation details.
* If you use a version tag in the url like this: https://github.com/MathKeyboardEngine/MathKeyboardEngine/tree/v0.2.3, you can see the git repository as it was for that version. That may not be needed if the changelog doesn't note any important changes.
Follow these steps to set up (and verify) a development environment for this repository:
npm ci
npm run strictcheck
to do type checking, to check whether a successful compilation is possible.npm run clean
to run eslint (performing auto-fixes).npm test
to run all unit tests from the 'tests' folder.npm run build
creates a single-file library in different formats and language versions in the 'dist' folder. Note: the 'src' folder contains all the source code files.> Go Live
in the bottom right corner of VS Code. The browser starts up automatically.The MathKeyboardEngine repositories use the most permissive licensing available. The "BSD Zero Clause License" (0BSD) allows for
commercial + non-commercial use, closed + open source, with + without modifications, etc. and is equivalent to licenses like:
The "BSD Zero Clause License" (0BSD) does not have the condition
(...), provided that the above copyright notice and this permission notice appear in all copies.
which is part of the "MIT License" (MIT) and its shorter equivalent "ISC License" (ISC). Apart from that they are all equivalent.
npm run clean
runs eslint.)FAQs
MathKeyboardEngine provides the logic - in JavaScript and LaTeX - for a highly customizable virtual math keyboard.
The npm package mathkeyboardengine receives a total of 210 weekly downloads. As such, mathkeyboardengine popularity was classified as not popular.
We found that mathkeyboardengine demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.