@stdlib/datasets-cdc-nchs-us-births-1994-2003 0.0.7 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CITATION.cff ADDED
@@ -0,0 +1,30 @@
1
+ cff-version: 1.2.0
2
+ title: stdlib
3
+ message: >-
4
+ If you use this software, please cite it using the
5
+ metadata from this file.
6
+
7
+ type: software
8
+
9
+ authors:
10
+ - name: The Stdlib Authors
11
+ url: https://github.com/stdlib-js/stdlib/graphs/contributors
12
+
13
+ repository-code: https://github.com/stdlib-js/stdlib
14
+ url: https://stdlib.io
15
+
16
+ abstract: |
17
+ Standard library for JavaScript and Node.js.
18
+
19
+ keywords:
20
+ - JavaScript
21
+ - Node.js
22
+ - TypeScript
23
+ - standard library
24
+ - scientific computing
25
+ - numerical computing
26
+ - statistical computing
27
+
28
+ license: Apache-2.0 AND BSL-1.0
29
+
30
+ date-released: 2016
package/NOTICE CHANGED
@@ -1 +1 @@
1
- Copyright (c) 2016-2021 The Stdlib Authors.
1
+ Copyright (c) 2016-2023 The Stdlib Authors.
package/README.md CHANGED
@@ -18,9 +18,20 @@ limitations under the License.
18
18
 
19
19
  -->
20
20
 
21
+
22
+ <details>
23
+ <summary>
24
+ About stdlib...
25
+ </summary>
26
+ <p>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.</p>
27
+ <p>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.</p>
28
+ <p>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.</p>
29
+ <p>To join us in bringing numerical computing to the web, get started by checking us out on <a href="https://github.com/stdlib-js/stdlib">GitHub</a>, and please consider <a href="https://opencollective.com/stdlib">financially supporting stdlib</a>. We greatly appreciate your continued support!</p>
30
+ </details>
31
+
21
32
  # US Birth Data (1994-2003)
22
33
 
23
- [![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url] [![dependencies][dependencies-image]][dependencies-url]
34
+ [![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url] <!-- [![dependencies][dependencies-image]][dependencies-url] -->
24
35
 
25
36
  > US birth data from 1994 to 2003, as provided by the Center for Disease Control and Prevention's National Center for Health Statistics.
26
37
 
@@ -139,62 +150,7 @@ for ( i = 0; i < 7; i++ ) {
139
150
 
140
151
  <!-- /.examples -->
141
152
 
142
- * * *
143
-
144
- <section class="cli">
145
-
146
- ## CLI
147
-
148
- <section class="installation">
149
-
150
- ## Installation
151
-
152
- To use the module as a general utility, install the module globally
153
-
154
- ```bash
155
- npm install -g @stdlib/datasets-cdc-nchs-us-births-1994-2003
156
- ```
157
-
158
- </section>
159
-
160
- <section class="usage">
161
-
162
- ### Usage
163
-
164
- ```text
165
- Usage: cdc-nchs-us-births-1994-2003 [options]
166
-
167
- Options:
168
-
169
- -h, --help Print this message.
170
- -V, --version Print the package version.
171
- ```
172
-
173
- </section>
174
-
175
- <!-- /.usage -->
176
-
177
- <section class="notes">
178
-
179
- ### Notes
180
-
181
- - Data is written to `stdout` as comma-separated values ([CSV][csv]), where the first line is a header line.
182
-
183
- <section class="examples">
184
-
185
- ### Examples
186
-
187
- ```bash
188
- $ cdc-nchs-us-births-1994-2003
189
- ```
190
-
191
- </section>
192
-
193
- <!-- /.examples -->
194
-
195
- </section>
196
153
 
197
- <!-- /.cli -->
198
154
 
199
155
  * * *
200
156
 
@@ -216,6 +172,22 @@ The data files (databases) are licensed under an [Open Data Commons Public Domai
216
172
 
217
173
  <!-- </license> -->
218
174
 
175
+ <!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
176
+
177
+ <section class="related">
178
+
179
+ ## See Also
180
+
181
+ - <span class="package-name">[`@stdlib/datasets-cdc-nchs-us-births-1994-2003-cli`][@stdlib/datasets-cdc-nchs-us-births-1994-2003-cli]</span><span class="delimiter">: </span><span class="description">CLI package for use as a command-line utility.</span>
182
+ - <span class="package-name">[`@stdlib/datasets-cdc-nchs-us-births-1969-1988`][@stdlib/datasets/cdc-nchs-us-births-1969-1988]</span><span class="delimiter">: </span><span class="description">US birth data from 1969 to 1988, as provided by the Center for Disease Control and Prevention's National Center for Health Statistics.</span>
183
+ - <span class="package-name">[`@stdlib/datasets-ssa-us-births-2000-2014`][@stdlib/datasets/ssa-us-births-2000-2014]</span><span class="delimiter">: </span><span class="description">US birth data from 2000 to 2014, as provided by the Social Security Administration.</span>
184
+
185
+ </section>
186
+
187
+ <!-- /.related -->
188
+
189
+ <!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
190
+
219
191
 
220
192
  <section class="main-repo" >
221
193
 
@@ -235,7 +207,7 @@ For more information on the project, filing bug reports and feature requests, an
235
207
 
236
208
  ## Copyright
237
209
 
238
- Copyright &copy; 2016-2021. The Stdlib [Authors][stdlib-authors].
210
+ Copyright &copy; 2016-2023. The Stdlib [Authors][stdlib-authors].
239
211
 
240
212
  </section>
241
213
 
@@ -245,25 +217,43 @@ Copyright &copy; 2016-2021. The Stdlib [Authors][stdlib-authors].
245
217
 
246
218
  <section class="links">
247
219
 
220
+ [@stdlib/datasets-cdc-nchs-us-births-1994-2003-cli]: https://www.npmjs.com/package/@stdlib/datasets-cdc-nchs-us-births-1994-2003-cli
221
+
248
222
  [npm-image]: http://img.shields.io/npm/v/@stdlib/datasets-cdc-nchs-us-births-1994-2003.svg
249
223
  [npm-url]: https://npmjs.org/package/@stdlib/datasets-cdc-nchs-us-births-1994-2003
250
224
 
251
- [test-image]: https://github.com/stdlib-js/datasets-cdc-nchs-us-births-1994-2003/actions/workflows/test.yml/badge.svg
252
- [test-url]: https://github.com/stdlib-js/datasets-cdc-nchs-us-births-1994-2003/actions/workflows/test.yml
225
+ [test-image]: https://github.com/stdlib-js/datasets-cdc-nchs-us-births-1994-2003/actions/workflows/test.yml/badge.svg?branch=v0.1.0
226
+ [test-url]: https://github.com/stdlib-js/datasets-cdc-nchs-us-births-1994-2003/actions/workflows/test.yml?query=branch:v0.1.0
253
227
 
254
228
  [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/datasets-cdc-nchs-us-births-1994-2003/main.svg
255
229
  [coverage-url]: https://codecov.io/github/stdlib-js/datasets-cdc-nchs-us-births-1994-2003?branch=main
256
230
 
231
+ <!--
232
+
257
233
  [dependencies-image]: https://img.shields.io/david/stdlib-js/datasets-cdc-nchs-us-births-1994-2003.svg
258
234
  [dependencies-url]: https://david-dm.org/stdlib-js/datasets-cdc-nchs-us-births-1994-2003/main
259
235
 
236
+ -->
237
+
260
238
  [chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg
261
- [chat-url]: https://gitter.im/stdlib-js/stdlib/
239
+ [chat-url]: https://app.gitter.im/#/room/#stdlib-js_stdlib:gitter.im
262
240
 
263
241
  [stdlib]: https://github.com/stdlib-js/stdlib
264
242
 
265
243
  [stdlib-authors]: https://github.com/stdlib-js/stdlib/graphs/contributors
266
244
 
245
+ [cli-section]: https://github.com/stdlib-js/datasets-cdc-nchs-us-births-1994-2003#cli
246
+ [cli-url]: https://github.com/stdlib-js/datasets-cdc-nchs-us-births-1994-2003/tree/cli
247
+ [@stdlib/datasets-cdc-nchs-us-births-1994-2003]: https://github.com/stdlib-js/datasets-cdc-nchs-us-births-1994-2003/tree/main
248
+
249
+ [umd]: https://github.com/umdjs/umd
250
+ [es-module]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
251
+
252
+ [deno-url]: https://github.com/stdlib-js/datasets-cdc-nchs-us-births-1994-2003/tree/deno
253
+ [umd-url]: https://github.com/stdlib-js/datasets-cdc-nchs-us-births-1994-2003/tree/umd
254
+ [esm-url]: https://github.com/stdlib-js/datasets-cdc-nchs-us-births-1994-2003/tree/esm
255
+ [branches-url]: https://github.com/stdlib-js/datasets-cdc-nchs-us-births-1994-2003/blob/main/branches.md
256
+
267
257
  [pddl-1.0]: http://opendatacommons.org/licenses/pddl/1.0/
268
258
 
269
259
  [cc0]: https://creativecommons.org/publicdomain/zero/1.0
@@ -272,6 +262,14 @@ Copyright &copy; 2016-2021. The Stdlib [Authors][stdlib-authors].
272
262
 
273
263
  [csv]: https://tools.ietf.org/html/rfc4180
274
264
 
265
+ <!-- <related-links> -->
266
+
267
+ [@stdlib/datasets/cdc-nchs-us-births-1969-1988]: https://www.npmjs.com/package/@stdlib/datasets-cdc-nchs-us-births-1969-1988
268
+
269
+ [@stdlib/datasets/ssa-us-births-2000-2014]: https://www.npmjs.com/package/@stdlib/datasets-ssa-us-births-2000-2014
270
+
271
+ <!-- </related-links> -->
272
+
275
273
  </section>
276
274
 
277
275
  <!-- /.links -->
@@ -0,0 +1,3 @@
1
+ /// <reference path="../docs/types/index.d.ts" />
2
+ import dataset from '../docs/types/index';
3
+ export = dataset;
package/dist/index.js ADDED
@@ -0,0 +1,5 @@
1
+ "use strict";var s=function(r,e){return function(){return e||r((e={exports:{}}).exports,e),e.exports}};var t=s(function(f,a){
2
+ var i=require("path").resolve,n=require('@stdlib/fs-read-json/dist').sync,o=i(__dirname,"..","data","data.json"),u={encoding:"utf8"};function v(){var r=n(o,u);if(r instanceof Error)throw r;return r}a.exports=v
3
+ });var d=t();module.exports=d;
4
+ /** @license Apache-2.0 */
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../lib/main.js", "../lib/index.js"],
4
+ "sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2019 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar resolve = require( 'path' ).resolve;\nvar readJSON = require( '@stdlib/fs-read-json' ).sync;\n\n\n// VARIABLES //\n\nvar fpath = resolve( __dirname, '..', 'data', 'data.json' );\nvar opts = {\n\t'encoding': 'utf8'\n};\n\n\n// MAIN //\n\n/**\n* Returns US birth data from 1994 to 2003, as provided by the Center for Disease Control and Prevention's National Center for Health Statistics.\n*\n* ## Notes\n*\n* - This function synchronously reads data from disk for each invocation. Such behavior is intentional and so is the avoidance of `require`. We assume that invocations are infrequent, and we want to avoid the `require` cache. This means that we allow data to be garbage collected and a user is responsible for explicitly caching data.\n*\n* @throws {Error} unable to read data\n* @returns {ObjectArray} birth data\n*\n* @example\n* var data = dataset();\n* // returns [ {...}, ... ]\n*/\nfunction dataset() {\n\tvar data = readJSON( fpath, opts );\n\tif ( data instanceof Error ) {\n\t\tthrow data;\n\t}\n\treturn data;\n}\n\n\n// EXPORTS //\n\nmodule.exports = dataset;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2019 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* US birth data from 1994 to 2003, as provided by the Center for Disease Control and Prevention's National Center for Health Statistics.\n*\n* @module @stdlib/datasets-cdc-nchs-us-births-1994-2003\n*\n* @example\n* var dataset = require( '@stdlib/datasets-cdc-nchs-us-births-1994-2003' );\n* var data = dataset();\n* // returns [ {...}, ... ]\n*/\n\n// MODULES //\n\nvar main = require( './main.js' );\n\n\n// EXPORTS //\n\nmodule.exports = main;\n"],
5
+ "mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAU,QAAS,MAAO,EAAE,QAC5BC,EAAW,QAAS,sBAAuB,EAAE,KAK7CC,EAAQF,EAAS,UAAW,KAAM,OAAQ,WAAY,EACtDG,EAAO,CACV,SAAY,MACb,EAmBA,SAASC,GAAU,CAClB,IAAIC,EAAOJ,EAAUC,EAAOC,CAAK,EACjC,GAAKE,aAAgB,MACpB,MAAMA,EAEP,OAAOA,CACR,CAKAN,EAAO,QAAUK,IC5BjB,IAAIE,EAAO,IAKX,OAAO,QAAUA",
6
+ "names": ["require_main", "__commonJSMin", "exports", "module", "resolve", "readJSON", "fpath", "opts", "dataset", "data", "main"]
7
+ }
@@ -16,7 +16,7 @@
16
16
  * limitations under the License.
17
17
  */
18
18
 
19
- // TypeScript Version: 2.0
19
+ // TypeScript Version: 4.1
20
20
 
21
21
  /**
22
22
  * Data point.
package/lib/index.js CHANGED
@@ -31,9 +31,9 @@
31
31
 
32
32
  // MODULES //
33
33
 
34
- var dataset = require( './main.js' );
34
+ var main = require( './main.js' );
35
35
 
36
36
 
37
37
  // EXPORTS //
38
38
 
39
- module.exports = dataset;
39
+ module.exports = main;
package/lib/main.js CHANGED
@@ -41,7 +41,6 @@ var opts = {
41
41
  *
42
42
  * - This function synchronously reads data from disk for each invocation. Such behavior is intentional and so is the avoidance of `require`. We assume that invocations are infrequent, and we want to avoid the `require` cache. This means that we allow data to be garbage collected and a user is responsible for explicitly caching data.
43
43
  *
44
- *
45
44
  * @throws {Error} unable to read data
46
45
  * @returns {ObjectArray} birth data
47
46
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stdlib/datasets-cdc-nchs-us-births-1994-2003",
3
- "version": "0.0.7",
3
+ "version": "0.1.0",
4
4
  "description": "US birth data from 1994 to 2003, as provided by the Center for Disease Control and Prevention's National Center for Health Statistics.",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -13,9 +13,6 @@
13
13
  "url": "https://github.com/stdlib-js/stdlib/graphs/contributors"
14
14
  }
15
15
  ],
16
- "bin": {
17
- "cdc-nchs-us-births-1994-2003": "./bin/cli"
18
- },
19
16
  "main": "./lib",
20
17
  "browser": "./lib/browser.js",
21
18
  "directories": {
@@ -43,26 +40,14 @@
43
40
  "url": "https://github.com/stdlib-js/stdlib/issues"
44
41
  },
45
42
  "dependencies": {
46
- "@stdlib/cli-ctor": "^0.0.x",
47
- "@stdlib/fs-read-file": "^0.0.x",
48
- "@stdlib/fs-read-json": "^0.0.x",
49
- "@stdlib/streams-node-stdout": "^0.0.x",
50
- "@stdlib/utils-copy": "^0.0.x"
43
+ "@stdlib/fs-read-json": "^0.1.0",
44
+ "@stdlib/utils-copy": "^0.1.0"
51
45
  },
52
46
  "devDependencies": {
53
- "@stdlib/assert-is-array": "^0.0.x",
54
- "@stdlib/assert-is-browser": "^0.0.x",
55
- "@stdlib/assert-is-object-array": "^0.0.x",
56
- "@stdlib/assert-is-windows": "^0.0.x",
57
- "@stdlib/bench": "^0.0.x",
58
- "@stdlib/fs-write-file": "^0.0.x",
59
- "@stdlib/process-exec-path": "^0.0.x",
60
- "@stdlib/regexp-eol": "^0.0.x",
61
- "@stdlib/stats-incr-mean": "^0.0.x",
62
47
  "proxyquire": "^2.0.0",
63
48
  "tape": "git+https://github.com/kgryte/tape.git#fix/globby",
64
49
  "istanbul": "^0.4.1",
65
- "tap-spec": "5.x.x"
50
+ "tap-min": "git+https://github.com/Planeshifter/tap-min.git"
66
51
  },
67
52
  "engines": {
68
53
  "node": ">=0.10.0",
@@ -94,7 +79,7 @@
94
79
  "time-series"
95
80
  ],
96
81
  "funding": {
97
- "type": "patreon",
98
- "url": "https://www.patreon.com/athan"
82
+ "type": "opencollective",
83
+ "url": "https://opencollective.com/stdlib"
99
84
  }
100
85
  }
package/bin/cli DELETED
@@ -1,77 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- /**
4
- * @license Apache-2.0
5
- *
6
- * Copyright (c) 2019 The Stdlib Authors.
7
- *
8
- * Licensed under the Apache License, Version 2.0 (the "License");
9
- * you may not use this file except in compliance with the License.
10
- * You may obtain a copy of the License at
11
- *
12
- * http://www.apache.org/licenses/LICENSE-2.0
13
- *
14
- * Unless required by applicable law or agreed to in writing, software
15
- * distributed under the License is distributed on an "AS IS" BASIS,
16
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
- * See the License for the specific language governing permissions and
18
- * limitations under the License.
19
- */
20
-
21
- 'use strict';
22
-
23
- // MODULES //
24
-
25
- var createReadStream = require( 'fs' ).createReadStream;
26
- var resolve = require( 'path' ).resolve;
27
- var readFileSync = require( '@stdlib/fs-read-file' ).sync;
28
- var stdout = require( '@stdlib/streams-node-stdout' );
29
- var CLI = require( '@stdlib/cli-ctor' );
30
-
31
-
32
- // MAIN //
33
-
34
- /**
35
- * Main execution sequence.
36
- *
37
- * @private
38
- */
39
- function main() {
40
- var flags;
41
- var fpath;
42
- var cli;
43
-
44
- // Create a command-line interface:
45
- cli = new CLI({
46
- 'pkg': require( './../package.json' ),
47
- 'options': require( './../etc/cli_opts.json' ),
48
- 'help': readFileSync( resolve( __dirname, '..', 'docs', 'usage.txt' ), {
49
- 'encoding': 'utf8'
50
- })
51
- });
52
-
53
- // Get any provided command-line options:
54
- flags = cli.flags();
55
- if ( flags.help || flags.version ) {
56
- return;
57
- }
58
-
59
- // Resolve the data file path:
60
- fpath = resolve( __dirname, '..', 'data', 'data.csv' );
61
-
62
- // Print the data to stdout:
63
- createReadStream( fpath )
64
- .pipe( stdout )
65
- .on( 'close', onClose );
66
-
67
- /**
68
- * Exits the CLI.
69
- *
70
- * @private
71
- */
72
- function onClose() {
73
- cli.close( 0 );
74
- }
75
- }
76
-
77
- main();
package/docs/repl.txt DELETED
@@ -1,18 +0,0 @@
1
-
2
- {{alias}}()
3
- Returns US birth data from 1994 to 2003, as provided by the Center for
4
- Disease Control and Prevention's National Center for Health Statistics.
5
-
6
- Returns
7
- -------
8
- out: Array<Object>
9
- Birth data.
10
-
11
- Examples
12
- --------
13
- > var data = {{alias}}()
14
- [ {...}, ... ]
15
-
16
- See Also
17
- --------
18
-
@@ -1,32 +0,0 @@
1
- /*
2
- * @license Apache-2.0
3
- *
4
- * Copyright (c) 2020 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
- import dataset = require( './index' );
20
-
21
-
22
- // TESTS //
23
-
24
- // The function returns an array of observations...
25
- {
26
- dataset(); // $ExpectType Observation[]
27
- }
28
-
29
- // The compiler throws an error if the function is provided arguments...
30
- {
31
- dataset( 3.12 ); // $ExpectError
32
- }
package/docs/usage.txt DELETED
@@ -1,8 +0,0 @@
1
-
2
- Usage: cdc-nchs-us-births-1993-2004 [options]
3
-
4
- Options:
5
-
6
- -h, --help Print this message.
7
- -V, --version Print the package version.
8
-
package/etc/cli_opts.json DELETED
@@ -1,14 +0,0 @@
1
- {
2
- "boolean": [
3
- "help",
4
- "version"
5
- ],
6
- "alias": {
7
- "help": [
8
- "h"
9
- ],
10
- "version": [
11
- "V"
12
- ]
13
- }
14
- }