
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
RiTa is implemented in JavaScript and Java, with a common API for both, and is free/libre/open-source.
Note: version 3.0 contains breaking changes -- please check the release notes
import { RiTa } from "https://esm.sh/rita";$ npm install ritalet { RiTa } = require('rita');<script src="https://cdn.jsdelivr.net/npm/rita"></script><script src="https://cdn.jsdelivr.net/npm/rita"></script>import { RiTa } from "https://esm.sh/rita";
// to analyze a sentence
let data = RiTa.analyze("The elephant took a bite!");
console.log(data);
// to load a grammar
let grammar = RiTa.grammar(rulesObjectOrJSON);
console.log(grammar.expand());
RiScript (the minor language that powers RiTa) was designed specifically for writers working with code. RiScript primitives (choices, symbols, gates, transforms, etc) can be used as part of any RiTa grammar or executed directly using RiTa.evaluate. For more info, see this interactive notebook on observable.
To install/build the library and run tests (with npm/mocha and node v14.x):
$ git clone https://github.com/dhowe/ritajs.git
$ cd ritajs
$ npm install
$ npm run build
$ npm test
If all goes well, you should see a list of successful tests and find the library built in 'dist'
Please make contributions via fork-and-pull - thanks!
Once you have things running with npm/mocha/tsup, you might also try VSCode.
Here you can see the tests in the VSCode Testing view
Create a new file on your desktop called 'test.html' with the following lines, save and drag it into a browser:
<html>
<script src="https://cdn.jsdelivr.net/npm/rita"></script>
<script>
window.onload = function() {
let words = RiTa.tokenize("The elephant took a bite!");
document.getElementById("content").innerHTML = words;
};
</script>
<div id="content" width=200 height=200></div>
<html>
Create a new file on your desktop called 'test.html' with the following lines, save and drag it into a browser:
<html>
<body>
<div id="content" width=200 height=200></div>
<script type="module">
import { RiTa } from "https://esm.sh/rita";
let words = RiTa.tokenize("The elephant took a bite!");
document.getElementById("content").innerHTML = words;
</script>
</body>
<html>
Create a new file on your desktop called 'test.html' with the following lines, save and drag it into a browser:
<html>
<script src="https://cdn.jsdelivr.net/npm/p5"></script>
<script src="https://cdn.jsdelivr.net/npm/rita"></script>
<script>
function setup() {
createCanvas(200,200);
background(245);
textAlign(CENTER);
textSize(20);
let words = RiTa.tokenize("The elephant took a bite!")
for (let i=0; i < words.length; i++) {
text(words[i], 100, 50 + i*20);
}
}
</script>
</html>
If you already have a sketch, simply add <script src="https://cdn.jsdelivr.net/npm/rita"></script> to your index.html to include RiTa.
To install: $ npm install rita
let RiTa = require('rita');
let data = RiTa.analyze("The elephant took a bite!");
console.log(data);
This project exists only because of the people who contribute. Thank you!
FAQs
tools for generative natural language
The npm package rita receives a total of 432 weekly downloads. As such, rita popularity was classified as not popular.
We found that rita demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.