ntl

授权协议 MIT License
开发语言 JavaScript
所属分类 应用工具、 终端/远程登录
软件类型 开源软件
地区 不详
投 递 者 於彬
操作系统 跨平台
开源组织
适用人群 未知
 软件概览






Node Task List

Interactive cli tool that lists and run package.json scripts.

An iPipeTo workflow


Table of Contents


⬇️ Install

$ npm install -g ntl

�� Usage

Navigate to any folder containing a package.json file (usually a Node.js project) that has configured scripts, then just use the ntl command:

ntl

You can also specify a path to a project folder containing a package.json file:

ntl ./my-node-project



�� Features

  • Interactive interface that lists all package.json scripts
  • Select any item in the interactive interface to execute that task
  • Add descriptions to each task that can be shown in the UI
  • Multiple interactive interfaces (menu list, autocomplete fuzzy search)
  • Many options to customize the UI (exclude scripts, amount of items, etc)
  • Easy to repeat last ran script (nt and rerun options)
  • Run multiple tasks
    • Repeat previously set of ran tasks
    • Preserve order of selection
  • Customize rerun cache options

�� Customize

Custom runner

By default Node Task List tries to use npm to run the configured script tasks. In case you want to use a custom runner (e.g: yarn or pnpm) you can configure ntl to use whatever runner you prefer.

That can be configured system-wide by setting the environment variable in your profile file (.bashrc or .bash_profile for macos). In case you only want to ever use yarn as your node task runner, you should set:

# .bashrc (linux) OR .bash_profile (macos)
export NTL_RUNNER=yarn

Keep in mind environment variables are flexible enough that they can also be set temporarily prior to running a command, so the following would also work:

NTL_RUNNER=yarn ntl

You can also define a runner in a per-project basis using the ntl configuration of your package.json, e.g:

{
  "name": "<project>",
  "version": "1.0.0",
  "ntl": {
    "runner": "yarn"
  }
}

Using task descriptions

�� You can define descriptions for your tasks in your package.json file by defining a ntl section, e.g:

{
  "name": "<project>",
  "version": "1.0.0",
  "scripts": {
    "build": "make build",
    "coverage": "jest --coverage",
    "test": "jest"
  },
  "ntl": {
    "descriptions": {
      "build": "Builds the project",
      "coverage": "Run test outputing code coverage",
      "test": "Run project's tests"
    }
  }
}

These descriptions will be shown anytime you run ntl.


Displaying task contents

Use the --info or simply -i option in order to display the contents of each script task, like:

$ ntl -i
⬢  Node Task List
? Select a task to run: (Use arrow keys)
❯ generate-manual › maked-man README.md > man/man1/ntl.1
          pretest › eslint cli.js rerun.js test
             test › cross-env NTL_NO_RERUN_CACHE=1 tap

Task contents will also be shown when using the --descriptions option and no description is available for a given item.


Exclude tasks from UI

You can define a list of scripts to be excluded from the interactive menu using the --exclude option:

$ ntl -e coverall tasks
⬢  Node Task List
? Select a task to run: (Use arrow keys)
❯ test
  test:watch

You can also use a wildcard character to exclude multiple scripts:

$ ntl -e "test*"
⬢  Node Task List
? Select a task to run: (Use arrow keys)
❯ coveralls
  tasks

Exclude tasks with missing descriptions

You can also filter out items that doesn't have a description using the --descriptions-only or -o option.


Customize cache

ntl uses a cache system that stores the last ran command for each project in order to make it easier for users to repeat it. Given its importance, the following environment variables are available in order to customize its location and size:

  • NTL_RERUN_CACHE_DIR: Defines a directory to store the cache file
  • NTL_RERUN_CACHE_NAME: Filename to use for the cache
  • NTL_RERUN_CACHE_MAX: Number of items to store in the cache (defaults to 10)
  • NTL_NO_RERUN_CACHE: When defined, avoid the cache system completely

For example, if a given user wanted to store its cache in ~/.ntl/cache location and save up to 100 items in it, they could add the following to their .bashrc (linux) or .bash_profile (macos):

export NTL_RERUN_CACHE_DIR=$HOME
export NTL_RERUN_CACHE_NAME=cache
export NTL_RERUN_CACHE_MAX=100

The cache can also be customized through command line options:

  • --rerun-cache-dir Defines a directory to store the cache file
  • --rerun-cache-name: Filename to use for the cache
  • --no-rerun-cache: Avoids the cache system completely

UI Size

You can increase/reduce the size of the presented UI list using the --size or -s option. In this example we just increased the size of the list to show up to 12 items at once:

$ ntl -s 12
⬢  Node Task List
? Select a task to run:
❯ build
  generate-manual
  hello
  bomdia
  bonjour
  test
  test:dev
  test:ci
  test:integration
  test:unit
  test:e2e
  start

The default size value is 7 items.


�� Repeat the last ran task

ntl provides many options to make it easier to rerun the last task, either through having it selected as default option the next time you run the ntl command, or by using one of the following:

  • The ultra convenient way: nt command shorthand �� (You should think of nt as: "ok, just run the last node task", in contrast to ntl which should be interpreted as: "ok, give me the node task list again") in case no previous task is available, running nt will behave exactly as ntl
  • Using a --rerun or -r flag, e.g: ntl -r
  • Prepending the NTL_RERUN env variable, e.g: NTL_RERUN=true ntl


Ⓜ️ Run multiple tasks

Using the --multiple or -m option, the interface becomes a checkbox-based list that allows you to select multiple tasks and run them in serial.

$ ntl -m
⬢  Node Task List
? Select a task to run:
 ◯ start
 ◉ test
❯◉ test:ci

Better yet, combine that with the rerun feature and you can repeat multiple tasks using the nt command.

Run multiple tasks in order of selection

You can run multiple tasks in the order you pick them �� Use the --ordered or -O option:

$ ntl -O
⬢  Node Task List
? Select a task to run: (Press <space> to select, <r> to res
et)
 ◯   bar › Test task
 ◯   foo › Test task
❯2 hello › Hello world
 ◯ start › Start the development server
 1  test › Run all tests for the project

Run in autocomplete or fuzzy search mode

Use --autocomplete or -A option in order to use an interface variation that allows you to type the name of the task instead of browsing through an arrow-based menu. This mode can be very helpful when managing a long list of tasks.

$ ntl -A
⬢  Node Task List
? Select a task to run: t
❯ pretest
  test
  start

demo animation showing how to use -m to have a checkbox interface allowing for selection of multiple tasks to be ran in serial


Tips

ntl as default task

You can define ntl as a dev dependency and one of the tasks of your project, specially start - so whenever someone runs npm start or yarn start they get the convenient ntl interface. Like in the following package.json example:

{
  "name": "<project>",
  "version": "1.0.0",
  "scripts": {
    "start": "ntl"
  },
  "devDependencies": {
    "ntl": "^5.0.0"
  }
}

Exclude scripts

You can also define a task that invokes ntl while excluding other tasks, e.g:

{
  "scripts": {
    "test": "jest --coverage",
    "test:watch": "jest --coverage --watchAll",
    "coveralls": "jest --coverage --coverageReporters=text-lcov | coveralls",
    "tasks": "ntl --exclude coverall tasks"
  }
}

Included command aliases

  • ntl The default command
  • nodetasklist Longhand version in case users have conflicting ntl commands
  • npm-tasklist Legacy longhand version
  • nt Rerun last script shortcut
  • nodetask Rerun last script longhand

ℹ️ Help

Still feel like you could use some --help ?

Usage:
  ntl [<path>]             Build an interactive interface and run any script
  nt [<path>]              Rerun last executed script

Options:
  -a, --all                Includes pre and post scripts on the list   [boolean]
  -A, --autocomplete       Starts in autocomplete mode                 [boolean]
  -D, --debug              Prints to stderr any internal error         [boolean]
  -d, --descriptions       Displays the descriptions of each script    [boolean]
  -o, --descriptions-only  Limits output to scripts with a description [boolean]
  -h, --help               Shows this help message                     [boolean]
  -i, --info               Displays the contents of each script        [boolean]
  -e, --exclude            Excludes specific scripts                     [array]
  -m, --multiple           Allows the selection of multiple items      [boolean]
  -O, --ordered            Selects multiple items in order             [boolean]
  -s, --size               Amount of lines to display at once           [number]
  --rerun-cache-dir        Defines the rerun task cache location        [string]
  --rerun-cache-name       Defines the rerun task cache filename        [string]
  --no-rerun-cache         Never write to or read from cache           [boolean]
  -v, --version            Show version number                         [boolean]
  -r, --rerun              Rerun last executed script                  [boolean]

Visit https://github.com/ruyadorno/ntl for more info

License

MIT © 2020 Ruy Adorno

  • NTL链接 NTL:用于做数论的库 NTL是一种高性能的可移植C ++库,提供用于处理带符号的任意长度整数以及整数和有限域上的矢量,矩阵和多项式的数据结构和算法。 默认情况下,NTL是线程安全的。 NTL是根据LGPLv2.1 +(即LGPL 2.1版或更高版本)分发的[更多详细信息] 如果您有兴趣为NTL的发展做出贡献,请与我联系(请参阅下面的联系信息)。我正在考虑几个项目,也很乐意讨论其他想法

  • 本文讲解NTL源码中关于内存管理的部分,下面提到源码文件a.h时同时指a.cpp。一个二进制数最低位为第0位。主要在<lip.h>, <ctools.h>中。NTL的重要的类ZZ存储任意长的有符号数。 常用数与函数 typedef unsigned long _ntl_limb_t; typedef long _ntl_signed_limb_t; typedef _ntl_limb_t *_nt

  • NTL 官网:https://libntl.org/doc/tour.html NTL is a high-performance, portable C++ library providing data structures and algorithms for arbitrary length integers; for vectors, matrices, and polynomials o

  • NTL:基本线程池 在坑了很久之后,今日琪琪子继续更新NTL技术文档。 从今天开始介绍NTL库的基本模块,首先介绍基本线程池。原始文档链接如下:https://shoup.net/ntl/doc/BasicThreadPool.cpp.html。 原文是以注释的形式将模块介绍了一下。 /****************************************************** 模

  • 2021SC@SDUSC 本章综述 大整数ZZ类主要实现了任意长度大整数表示、最大公因数、Jacobi符号和素性检验。笔者将通过逐个分析ZZ.cpp源代码中函数的形式来一步步向读者展示NTL是如何实现上述功能的。 代码分析 (1)判断输入的I/O是否合法: static NTL_CHEAP_THREAD_LOCAL long iodigits = 0; static NTL_CHEAP_THREA

  • 官网链接 NTL: A Library for doing Number Theory 下面介绍使用Windows系统的Visual Studio软件的NTL安装使用教程。在不全面了解这个库的情况下,可以把库的源文件都编译为静态库来使用。 编译为静态库 1. 在官网下载压缩文件并解压。 2. 打开Visual Studio,文件--->新建--->项目,选择静态库,项目名可以任取,选择确定,创建项

  • 2021SC@SDUSC RSA算法原理 密钥生成的步骤 第一步,随机选择两个不相等的质数p和q。 爱丽丝选择了61和53。(实际应用中,这两个质数越大,就越难破解。) 第二步,计算p和q的乘积n。 爱丽丝就把61和53相乘。 n = 61×53 = 3233 n的长度就是密钥长度。3233写成二进制是110010100001,一共有12位,所以这个密钥就是12位。实际应用中,RSA密钥一般是10

  • 在经过了漫长的怠工之后,琪琪子继续为大家更新NTL库,今天主要是NTL中的伽罗瓦域GF2上的模2多项式模块,在这里我们先给出官方文档,随后给出在sage软件中封装好GF2X模块,由于sage的语法更加类似python,我们甚至不需要直接使用NTL lib。 /**********************************************************************

 相关资料
  • 问题内容: 尝试使用JavaMail中的NTLM连接到Exchange服务器。我可以连接到SMTP,但不能连接到IMAP。我还可以使用相同的主机/用户名/密码通过OS X Mail.app应用程序进行身份验证,帐户类型=“ IMAP”,端口143,ssl = false,authentication = NTLM,域名=“。 连接代码: 输出: 我尝试通过http://www.oracle.com

  • 问题内容: 我正在尝试使用Apache / Jakarta HttpClient 4.1.1使用给定的凭据连接到任意网页。为了测试这一点,我在运行只有一次身份验证模式的开发机上安装了IIS 7.5的最小安装。基本身份验证工作正常,但是每当我尝试登录时,摘要和NTLM都会返回401错误消息。这是我的代码: 我在Fiddler中注意到的一件事是Firefox与HttpClient发送的哈希值不同,这使

  • 问题内容: 我们的团队构建了一个WebLogic Intranet网站。用户当前必须输入其Active Directory登录名/密码才能访问该站点。 由于我们的大多数用户已经登录到域,因此我们想使用集成Windows身份验证,因此用户不必重新输入其登录密码。 我已经使用Windows / IIS上托管的.NET应用程序完成了此操作。但是,此应用程序内置于WebLogic / Java中,并托管在

  • 问题内容: 我想在我的Java应用程序中使用Windows NTLM认证来透明地认证Intranet用户。如果使用浏览器(单点登录),用户将不会注意到任何身份验证。 我发现了一些具有NTLM支持的库,但是不知道要使用哪个库: http://spnego.sourceforge.net/ http://sourceforge.net/projects/ntlmv2auth/ http://jcifs

  • 问题内容: Golang网络抓取工具需要从经过NTLM认证的网页中提取信息。 拥有有效的用户名和密码后,网络抓取工具如何与服务器执行NTLM 4向握手,以获取对后面受保护网页的访问权限? 问题答案: 您可以在开始抓取之前使用类似身份验证的包。

  • 问题内容: 我正在寻找使用Windows用户调用应用程序的系统凭据在Go HTTP请求中进行NTLM身份验证的阻力最小的路径。 在C#/。NET中,我将能够通过 在Python中,可以通过以下方式获得等效结果 但我无法找到有关如何在Go中执行相同操作的任何资源。我当然可以使用一个库进行NTLM身份验证,并手动提供用户名/密码,但是这里的目标是避免将它们输入。 问题答案: 在进一步深入研究之后,看起

  • 问题内容: 我正在使用Spring 3 Web应用程序,因为Spring 3不支持NTLM身份验证,可以与Spring安全性一起使用的其他替代方法有哪些?这样,当用户登录到Active Directory时就可以通过应用程序进行身份验证了吗? 目前,Kerberos解决方案不是一个选择,NTLM是唯一的选择。 任何帮助都是非常明显的。 谢谢 问题答案: 我已经做过一次了。在这里抓住它。它将需要在A

  • 我有一个问题与身份验证NTLM credenitals,当我使用有效的凭据,它的作品,但当我使用无效的凭据它不会失败,它的作品一样,因为它会与有效的凭据。只有当我首先输入有效凭据时才会出现这种情况。有没有办法清除凭据,或者我在这里做错了什么?这是我的代码: 我注意到一件事,如果我输入有效的文件夹,然后等待几分钟,输入无效的文件,它会像预期的那样工作。 更新 我已经更新了我的代码,这样: 添加缓存策