|
| 1 | +/** |
| 2 | +* @license Apache-2.0 |
| 3 | +* |
| 4 | +* Copyright (c) 2021 The Stdlib Authors. |
| 5 | +* |
| 6 | +* Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | +* you may not use this file except in compliance with the License. |
| 8 | +* You may obtain a copy of the License at |
| 9 | +* |
| 10 | +* http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | +* |
| 12 | +* Unless required by applicable law or agreed to in writing, software |
| 13 | +* distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | +* See the License for the specific language governing permissions and |
| 16 | +* limitations under the License. |
| 17 | +*/ |
| 18 | + |
| 19 | +/* eslint-disable node/no-sync, no-console */ |
| 20 | + |
| 21 | +'use strict'; |
| 22 | + |
| 23 | +// MODULES // |
| 24 | + |
| 25 | +var readFileSync = require( 'fs' ).readFileSync; |
| 26 | +var join = require( 'path' ).join; |
| 27 | + |
| 28 | + |
| 29 | +// MAIN // |
| 30 | + |
| 31 | +// Path to the root directory: |
| 32 | +var dir = join( __dirname, '..', '..' ); |
| 33 | + |
| 34 | +// File path to the root package.json file: |
| 35 | +var fpath = join( dir, 'package.json' ); |
| 36 | + |
| 37 | +// Read the root package.json file: |
| 38 | +var pkg = JSON.parse( readFileSync( fpath, 'utf8' ) ); |
| 39 | + |
| 40 | +// Extract list of dependencies from the root package.json file and write newline-delimited list of `@stdlib` dependencies to stdout: |
| 41 | +var keys = Object.keys( pkg.dependencies ); |
| 42 | +var key; |
| 43 | +var i; |
| 44 | + |
| 45 | +for ( i = 0; i < keys.length; i++ ) { |
| 46 | + key = keys[ i ]; |
| 47 | + if ( key.startsWith( '@stdlib' ) ) { |
| 48 | + console.log( key ); |
| 49 | + } |
| 50 | +} |
0 commit comments