@stdlib/utils-library-manifest

Load a manifest for compiling source files.

https://github.com/stdlib-js/utils-library-manifest

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (17.4%) to scientific vocabulary

Keywords

compile config configuration files javascript lib library load manager manifest node node-js nodejs package program source standard stdlib tools
Last synced: 4 months ago · JSON representation ·

Repository

Load a manifest for compiling source files.

Basic Info
Statistics
  • Stars: 1
  • Watchers: 3
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Topics
compile config configuration files javascript lib library load manager manifest node node-js nodejs package program source standard stdlib tools
Created over 4 years ago · Last pushed 5 months ago
Metadata Files
Readme Changelog Contributing License Code of conduct Citation Security

README.md

About stdlib...

We believe in a future in which the web is a preferred environment for numerical computation. To help realize this future, we've built stdlib. stdlib is a standard library, with an emphasis on numerical and scientific computation, written in JavaScript (and C) for execution in browsers and in Node.js.

The library is fully decomposable, being architected in such a way that you can swap out and mix and match APIs and functionality to cater to your exact preferences and use cases.

When you use stdlib, you can be absolutely certain that you are using the most thorough, rigorous, well-written, studied, documented, tested, measured, and high-quality code out there.

To join us in bringing numerical computing to the web, get started by checking us out on GitHub, and please consider financially supporting stdlib. We greatly appreciate your continued support!

Manifest

NPM version Build Status Coverage Status <!-- dependencies -->

Load a manifest for compiling source files.

## Installation ```bash npm install @stdlib/utils-library-manifest ```
## Usage ```javascript var manifest = require( '@stdlib/utils-library-manifest' ); ``` #### manifest( filepath, conditions\[, options] ) Loads a manifest for compiling source files. ```javascript var conditions = { 'os': 'linux' }; var conf = manifest( './examples/manifest.json', conditions ); // returns ``` The function accepts the following `options`: - **basedir**: base directory from which to search for dependencies. Default: current working directory. - **paths**: path convention. Must be either `'win32'`, `'mixed'`, or `'posix'`. Default: based on host platform. The default search directory is the current working directory of the calling process. To specify an alternative search directory, set the `basedir` option. ```javascript var conditions = { 'os': 'linux' }; var opts = { 'basedir': __dirname }; var conf = manifest( './examples/manifest.json', conditions, opts ); // returns ```
## Notes - A _manifest_ is a [JSON][json] file having the following fields: - **options**: an `object` containing key-value pairs. Each key corresponds to a field in **confs** and may be used to conditionally select a configuration. Each value corresponds to the key's default value. The value for each field in a provided `conditions` object which has a corresponding field in **options** overrides the default value. Option keys are akin to primary keys in relational databases, in the sense that they should be used to uniquely identify a particular configuration. While individual key values may be shared across configurations, each configuration should have a unique combination of key values. Furthermore, default option values considered as a unique set should identify one and only one default configuration. - **fields**: an object `array` where each `object` has the following fields: - **field**: key name corresponding to a field in **confs**. - **resolve**: `boolean` indicating whether to resolve field values as file paths. If `true`, all field values are resolved relative to the manifest file. - **relative**: `boolean` indicating whether to resolve field values as relative file paths. This field is **only** considered when a manifest is a root manifest. If `true`, all field values, including those originating from dependencies, are resolved as relative file paths relative the root manifest. - **confs**: an object `array` where each `object` corresponds to a manifest configuration. Each `object` has the following fields: - **src**: `array` of source files. - **include**: `array` of include directories. - **libraries**: `array` of linked library dependencies. - **libpath**: `array` of linked library paths. - **dependencies**: `array` of package dependencies containing source files. An example _manifest_: ```text { "options": { "os": "linux" }, "fields": [ { "field": "src", "resolve": true, "relative": true }, { "field": "include", "resolve": true, "relative": false }, { "field": "libraries", "resolve": false, "relative": false }, { "field": "libpath", "resolve": true, "relative": false } ], "confs": [ { "os": "linux", "src": [ "./src/foo_linux.f", "./src/foo_linux.c" ], "include": [ "./include" ], "libraries": [], "libpath": [], "dependencies": [ "@stdlib/blas/base/daxpy", "@stdlib/blas/base/dasum", "@stdlib/blas/base/dcopy" ] } ] } ``` - The function recursively walks the manifest dependency tree to resolve **all** source files, libraries, library paths, and include directories. - An input `filepath` may be either a relative or absolute file path. If provided a relative file path, a manifest is resolved relative to the base search directory. - If a `conditions` object contains fields which do not correspond to manifest options, those fields are ignored (i.e., the "extra" fields have no effect when filtering manifest configurations). This allows providing a `conditions` object containing fields which only apply to certain subsets of manifest dependencies. - If no fields in a `conditions` object have corresponding fields in a manifest's options, the function returns a manifest's default configuration.
## Examples ```javascript var join = require( 'path' ).join; var manifest = require( '@stdlib/utils-library-manifest' ); // Resolve the absolute path of the manifest JSON file: var fpath = join( __dirname, 'examples', 'manifest.json' ); // Specify conditions for determining which configuration to load: var conditions = { 'os': 'mac' }; // Specify options: var opts = { 'basedir': __dirname }; // Load a manifest configuration: var conf = manifest( fpath, conditions, opts ); console.dir( conf ); ```

## CLI
## Installation To use as a general utility, install the CLI package globally ```bash npm install -g @stdlib/utils-library-manifest-cli ```
### Usage ```text Usage: library-manifest [options] [-- --=value ...] Options: -h, --help Print this message. -V, --version Print the package version. --dir basedir Base search directory. --paths convention Path convention. ```
### Notes - Use command-line flags to specify conditions by placing them after a `--` separator.
### Examples ```bash $ library-manifest ./examples/manifest.json -- --os mac ```

* * * ## Notice This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more. For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib]. #### Community [![Chat][chat-image]][chat-url] --- ## License See [LICENSE][stdlib-license]. ## Copyright Copyright © 2016-2025. The Stdlib [Authors][stdlib-authors].

Owner

  • Name: stdlib
  • Login: stdlib-js
  • Kind: organization

Standard library for JavaScript.

Citation (CITATION.cff)

cff-version: 1.2.0
title: stdlib
message: >-
  If you use this software, please cite it using the
  metadata from this file.

type: software

authors:
  - name: The Stdlib Authors
    url: https://github.com/stdlib-js/stdlib/graphs/contributors

repository-code: https://github.com/stdlib-js/stdlib
url: https://stdlib.io

abstract: |
  Standard library for JavaScript and Node.js.

keywords:
  - JavaScript
  - Node.js
  - TypeScript
  - standard library
  - scientific computing
  - numerical computing
  - statistical computing

license: Apache-2.0 AND BSL-1.0

date-released: 2016

GitHub Events

Total
  • Push event: 6
Last Year
  • Push event: 6

Committers

Last synced: almost 2 years ago

All Time
  • Total Commits: 53
  • Total Committers: 1
  • Avg Commits per committer: 53.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 16
  • Committers: 1
  • Avg Commits per committer: 16.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
stdlib-bot n****y@s****o 53
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 5 months ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • npm 1,606,340 last-month
  • Total docker downloads: 481,308,706
  • Total dependent packages: 684
  • Total dependent repositories: 1,031
  • Total versions: 13
  • Total maintainers: 4
npmjs.org: @stdlib/utils-library-manifest

Load a manifest for compiling source files.

  • Homepage: https://stdlib.io
  • License: Apache-2.0
  • Latest release: 0.2.2
    published over 1 year ago
  • Versions: 13
  • Dependent Packages: 684
  • Dependent Repositories: 1,031
  • Downloads: 1,606,340 Last month
  • Docker Downloads: 481,308,706
Rankings
Dependent packages count: 0.1%
Docker downloads count: 0.1%
Downloads: 0.1%
Dependent repos count: 0.6%
Average: 5.5%
Forks count: 15.4%
Stargazers count: 16.7%
Funding
  • type: opencollective
  • url: https://opencollective.com/stdlib
Last synced: 5 months ago

Dependencies

package.json npm
  • @stdlib/assert-is-browser ^0.0.x development
  • @stdlib/assert-is-plain-object ^0.0.x development
  • @stdlib/assert-is-windows ^0.0.x development
  • @stdlib/fs-read-file ^0.0.x development
  • @stdlib/process-exec-path ^0.0.x development
  • @stdlib/utils-keys ^0.0.x development
  • istanbul ^0.4.1 development
  • tap-spec 5.x.x development
  • tape git+https://github.com/kgryte/tape.git#fix/globby development
  • @stdlib/cli-ctor ^0.0.x
  • @stdlib/fs-resolve-parent-path ^0.0.x
  • @stdlib/utils-convert-path ^0.0.x
  • debug ^2.6.9
  • resolve ^1.1.7
.github/workflows/cancel.yml actions
  • styfle/cancel-workflow-action 0.11.0 composite
.github/workflows/close_pull_requests.yml actions
  • superbrothers/close-pull-request v3 composite
.github/workflows/examples.yml actions
  • actions/checkout v3 composite
  • actions/setup-node v3 composite
.github/workflows/npm_downloads.yml actions
  • actions/checkout v3 composite
  • actions/setup-node v3 composite
  • actions/upload-artifact v3 composite
  • distributhor/workflow-webhook v3 composite
.github/workflows/publish.yml actions
  • JS-DevTools/npm-publish v1 composite
  • act10ns/slack v1 composite
  • actions/checkout v3 composite
  • actions/setup-node v3 composite
  • styfle/cancel-workflow-action 0.11.0 composite
.github/workflows/test.yml actions
  • act10ns/slack v1 composite
  • actions/checkout v3 composite
  • actions/setup-node v3 composite
.github/workflows/test_coverage.yml actions
  • act10ns/slack v1 composite
  • actions/checkout v3 composite
  • actions/setup-node v3 composite
  • codecov/codecov-action v3 composite
  • distributhor/workflow-webhook v3 composite
.github/workflows/test_install.yml actions
  • act10ns/slack v1 composite
  • actions/checkout v3 composite
  • actions/setup-node v3 composite