пакет: создание - ponyatov/nimbook GitHub Wiki

пакет: создание

https://github.com/nim-lang/nimble#creating-packages

~$ nimble init hello
      Info: Package initialisation requires info which could not be inferred.
        ... Default values are shown in square brackets, press
        ... enter to use them.
      Using "hello" for new package name
    Prompt: Your name? [Anonymous]
    Answer: Nim Programmer
      Using "src" for new package source directory
    Prompt: Package type?
        ... Library - provides functionality for other packages.
        ... Binary  - produces an executable for the end-user.
        ... Hybrid  - combination of library and binary
        ... For more information see https://goo.gl/cm2RX5
     Select Cycle with 'Tab', 'Enter' when done
   Choices:  library  
           > binary <
             hybrid  
    Answer: binary
    Prompt: Initial version of package? [0.1.0]
    Answer: 
    Prompt: Package description? [A new awesome nimble package]
    Answer: Hello World
    Prompt: Package License?
        ... This should ideally be a valid SPDX identifier. See https://spdx.org/licenses/.
     Select Cycle with 'Tab', 'Enter' when done
   Choices:> MIT <
             GPL-2.0  
             Apache-2.0  
             ISC  
             GPL-3.0  
             BSD-3-Clause  
             LGPL-2.1  
             LGPL-3.0  
             EPL-2.0  
             Proprietary  
             Other  
    Answer: MIT
    Prompt: Package Backend?
        ... c    - Compile using C backend.
        ... cpp  - Compile using C++ backend.
        ... objc - Compile using Objective-C backend.
        ... js   - Compile using JavaScript backend.
     Select Cycle with 'Tab', 'Enter' when done
   Choices:> c <
             cpp  
             objc  
             js  
    Answer: c
    Prompt: Lowest supported Nim version? [1.2.0]
    Answer: 
   Success: Package hello created successfully
~$ find hello -t f
hello/src/hello.nim
hello/hello.nimble

Hello World