Socket
Socket
Sign inDemoInstall

atable.js

Package Overview
Dependencies
1
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    atable.js

tabulate your free text


Version published
Maintainers
1
Created

Readme

Source

atable.js

tabulate your free text

simple usage

import atable from "atable.js";

const result = atable(in, options);
/*
    result has vectors by keywords most appeared

    "no-keyword","src","feat:","first","version","iimplementations","2","minutes"
    "##AGO##",".gitignore","Initial","commit","3","hours",,
    "##AGO##","LICENSE","Initial","commit","3","hours",,
*/
  • result type is Tabulated here
  • options type is Options here

command-line app

$ npx atable out.csv in.txt [options(optional)]
  • default arguments are
    • output-csv: "atableout.csv"
    • input-text: "atablein.txt"
    • options: default

in

src
feat: first version iimplementations
2 minutes ##AGO##
.gitignore
Initial commit
3 hours ##AGO##
LICENSE
Initial commit
3 hours ##AGO##
README.md
feat: setup repo
3 hours ##AGO##
package-lock.json
feat: first version iimplementations
2 minutes ##AGO##
package.json
feat: first version iimplementations
2 minutes ##AGO##
tsconfig.json
feat: first version iimplementations
2 minutes ##AGO##

vectorize words by most appear keyword

out

"no-keyword","src","feat:","first","version","iimplementations","2","minutes"
"##AGO##",".gitignore","Initial","commit","3","hours",,
"##AGO##","LICENSE","Initial","commit","3","hours",,
"##AGO##","README.md","feat:","setup","repo","3","hours",
"##AGO##","package-lock.json","feat:","first","version","iimplementations","2","minutes"
"##AGO##","package.json","feat:","first","version","iimplementations","2","minutes"
"##AGO##","tsconfig.json","feat:","first","version","iimplementations","2","minutes"
"##AGO##",,,,,,,

default options

{
    "delims": [
        " ", "\t", "\n"
    ],
    "empty": "pad",
    "keyword": {
        "take": "most",
        "top": 1
    }
}
  • delims
    • separates input.txt by its words into tokens
    • can specify more 2 length
  • empty
    • "pad": avoid empty tokens such as between continued keyword
    • "keep": keep them
  • keyword.take
    • decide first column token
    • "most": single keyword will be first column, its most appeared in tokens
    • "top": keyword.top's appeard tokens ranking will be first

for example.

{
    "delims": [
        " ", "\t", "\n"
    ],
    "empty": "pad",
    "keyword": {
        "take": "top",
        "top": 2
    }
}

makes

"no-keyword","src","","","",""
"feat:","first","version","iimplementations","2","minutes"
"feat:","setup","repo","3","hours",""
"feat:","first","version","iimplementations","2","minutes"
"feat:","first","version","iimplementations","2","minutes"
"feat:","first","version","iimplementations","2","minutes"
"##AGO##",".gitignore","Initial","commit","3","hours"
"##AGO##","LICENSE","Initial","commit","3","hours"
"##AGO##","README.md","","","",""
"##AGO##","package-lock.json","","","",""
"##AGO##","package.json","","","",""
"##AGO##","tsconfig.json","","","",""
"##AGO##","","","","",""

Keywords

FAQs

Last updated on 27 Mar 2022

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc