npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript.Learn more »

anitomyscript

1.0.2 • Public • Published

anitomyscript

Build Status

Pure javascript bindings for Anitomy, ported with emscripten. Runs on Node or the browser!

Demo

You can test it here.

Installation

Anitomyscript is pure javascript and doesn't have any dependencies. Simply run

npm install anitomyscript

and you're good to go!

Usage

Node

var anitomy = require('anitomyscript');
anitomy.parse(file);

Browser

<script src="dist/bundle.min.js"></script>
<script>
  window.anitomyscript.parse(file);
</script> 

API

parse(file, [options])

Parses a file or an array of files.

console.log(
  anitomy.parse("[tlacatlc6] Natsume Yuujinchou Shi Vol. 1v2 & Vol. 2 (BD 1280x720 x264 AAC)")
);
/*
{
   "anime_title":"Natsume Yuujinchou Shi",
   "audio_term":"AAC",
   "file_name":"[tlacatlc6] Natsume Yuujinchou Shi Vol. 1v2 & Vol. 2 (BD 1280x720 x264 AAC)",
   "release_group":"tlacatlc6",
   "release_version":"2",
   "source":"BD",
   "video_term":"x264",
   "video_resolution":"1280x720",
   "volume_number":[
      "1",
      "2"
   ]
}
*/

AnitomyNative

If you need more control over anitomy's behavior, anitomyscript exposes an object with native anitomy symbols. For more exemples check out the tests.

const native = new anitomyscript.AnitomyNative();
const elements = new native.Anitomy().parse(file, options);
console.log(elements.size());

AnitomyNative.Anitomy

Anitomy instance with some native methods like parse(), elements(), options() and tokens()

AnitomyNative.Elements

Parsed elements

AnitomyNative.Options

Anitomy's parse options

AnitomyNative.ElementCategory

Anitomy's parsed elements categories

AnitomyNative.VectorString_t

Vector of strings

AnitomyNative.VectorElements

Vector of elements

install

npm i anitomyscript

Downloadsweekly downloads

2

version

1.0.2

license

BSD-2-Clause

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability