Skip to content

Commit 95a6877

Browse files
change tests to node:test + add github workflow
1 parent 9597e42 commit 95a6877

File tree

10 files changed

+86
-467
lines changed

10 files changed

+86
-467
lines changed

.github/workflows/test.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Test
2+
3+
4+
on: [ push, pull_request ]
5+
6+
jobs:
7+
test:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Checkout repository
12+
uses: actions/checkout@v4
13+
14+
- name: Setup Node.js
15+
uses: actions/setup-node@v4
16+
with:
17+
node-version: '22'
18+
cache: 'npm'
19+
20+
- name: Install dependencies
21+
run: npm ci
22+
23+
- name: Run linter
24+
run: npm run lint
25+
26+
- name: Run tests
27+
run: npm test

.travis.yml

Lines changed: 0 additions & 7 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## btparse [![Build Status](https://travis-ci.org/reklatsmasters/btparse.svg?branch=master)](https://travis-ci.org/reklatsmasters/btparse) [![npm](https://img.shields.io/npm/v/btparse.svg)](https://npmjs.org/package/btparse) [![license](https://img.shields.io/npm/l/btparse.svg)](https://npmjs.org/package/btparse) [![downloads](https://img.shields.io/npm/dm/btparse.svg)](https://npmjs.org/package/btparse)
1+
## btparse [![Tests](https://github.com/reklatsmasters/btparse/actions/workflows/test.yml/badge.svg)](https://travis-ci.org/reklatsmasters/btparse) [![npm](https://img.shields.io/npm/v/btparse.svg)](https://npmjs.org/package/btparse) [![license](https://img.shields.io/npm/l/btparse.svg)](https://npmjs.org/package/btparse) [![downloads](https://img.shields.io/npm/dm/btparse.svg)](https://npmjs.org/package/btparse)
22

33
A modern bencode parser focused on speed and perfomance. It used [`recursive descent parser`](https://en.wikipedia.org/wiki/Recursive_descent_parser), a kind of [`top-down`](https://en.wikipedia.org/wiki/Top-down_parsing) parsers.
44

bench/compare.js

Lines changed: 0 additions & 51 deletions
This file was deleted.

example.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import * as fs from 'node:fs';
22
import path from 'node:path';
3-
43
import decode from './index.js';
54

6-
const file = fs.readFileSync(path.join(import.meta.dirname, 'bench/test.torrent'))
5+
const file = fs.readFileSync(
6+
path.join(import.meta.dirname, 'bench/test.torrent'),
7+
);
78

8-
console.log(decode(file).info.pieces);
9+
console.log(decode(file).announce.toString());

lib/lazy.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable camelcase */
21
import * as c from './const.js';
32
import next from './lexer.js';
43
import * as avltree from './avltree.js';

0 commit comments

Comments
 (0)