paceaux / methodius

A utility for analyzing text on the web
Other
5 stars 2 forks source link

Convert project to TypeScript #18

Closed paceaux closed 8 months ago

paceaux commented 1 year ago

Project should be in TS b/c that would be easier for documentation.

paceaux commented 1 year ago

Branch created: https://github.com/paceaux/methodius/tree/issue18-convert-to-ts

paceaux commented 1 year ago

How to test this

1: Create a test project (e.g. methodius-test)

put this in an index.js file:


const Methodius = require('methodius');
const test = new Methodius('Hey there frank. How is it going? Is there anything you would like to do? I am wondering what happens here. I am excited. This should be fun.');

const ngrams = test.bigrams;

console.log(ngrams);
console.log(test.trigrams);
  1. Add this to the scripts for the project's package.json
    
    "scripts": {
    "test": "node index.js"
    }

3. In the Methodius package, set it as a link:
```Bash
npm link
  1. In the test package, tell it to use your local package:
 npm unlink methodius && npm link methodius && npm run test

Expected result:

console.log runs without error.

paceaux commented 8 months ago

This runs without error. It was a lot of effort. Got released in 2.0.0 last night. Someone please clap.

:clap: