@esri/hub-downloads v14.2.0
@esri/hub.js
compact, modular JavaScript wrappers for ArcGIS Hub that run in Node.js and modern browsers.
Table of Contents
Example
npm install @esri/hub-initiatives
import { fetchInitiative } from '@esri/hub-initiatives';
// pass in an initiative id
fetchInitiative("abc123")
.then(
response => // get back initiative metadata
);
API Reference
The documentation is published at http://esri.github.io/hub.js/ (source code here).
Instructions
You can install dependencies (and bootstrap lerna) by cloning the repository and running:
npm install
Afterward, for a list of all available commands run npm run
.
Some useful commands include:
npm test
runs all the tests and confirms the API is functioning as expected.- There is also a
Debug Node Tests
configuration in the.vscode/launch.json
which will run the Node tests in the VS Code debugger. npm run docs:serve
will run the documentation site locally at http://localhost:3000npm run build
will created UMD bundles for all the packagesnpm run dev -- <esm|node|umd> <glob>
will re-run the specified build type any time the source code changes in the matched package(s). Example:npm run dev -- umd @esri/hub-initiatives
Packages
@esri/hub-common
- Common TypeScript types and utility functions.@esri/hub-initiatives
- Helper functions for working with Initiatives.@esri/hub-annotations
- Helper functions for working with Annotations.@esri/hub-sites
- Helper functions for working with Sites, Pages and Domains.@esri/hub-auth
- Helper functions for authentication for external applications.@esri/hub-events
- Helper functions for working with Events.@esri/hub-search
- Helper functions for search on ArcGIS Online.@esri/hub-surveys
- Helper functions for working with Surveys.@esri/hub-teams
- Helper functions for working with Surveys.@esri/hub-members
- Helper functions for working with Hub Members.@esri/hub-content
- Helper functions for working with Hub Content.
Design Philosophy
hub.js
is designed as a set of data manipulation functions, not persistent objects with behavior. You should not use new
in conjunction with this library. Just include the modules your application needs and use them to hide lower-level abstractions for making API calls for hub related things. Your application should manage the state of the data you receive from these methods.
This project builds on the packages in arcgis-rest-js
, so if you want even lower-level access, you can also use them directly.
Why Not Objects?
Persistent objects often introduce memory leaks in JavaScript applications. As soon as you instantiate a new
object, you need to consider its lifespan. If you happen to assign that object inside a closure or somewhere else long-lived, you might end up with references that cannot be destroyed by the garbage collector. Creating clean separation between functions-that-fetch-or-manipulate-data and application-state-as-a-javascript-object helps to avoid this problem.
We are aiming for functional equivalence to hub-py
so that the objects and capabilities are familiar, not necessarily to make the APIs identical.
More about Javascript Memory Leaks
Frequently Asked Questions
- Is this a supported Esri product?
- Why TypeScript? What if I prefer Vanilla.js?
Issues
If something isn't working the way you expected, please take a look at previously logged issues first. Have you found a new bug? Want to request a new feature? We'd love to hear from you.
If you're looking for help you can also post issues on GIS Stackexchange.
Versioning
For transparency into the release cycle and in striving to maintain backward compatibility, @esri/hub.js is maintained under Semantic Versioning guidelines and will adhere to these rules whenever possible.
For more information on SemVer, please visit http://semver.org/.
Contributing
Esri welcomes contributions from anyone and everyone. Please see our guidelines for contributing.
License
Copyright © 2018-2019 Esri
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
A copy of the license is available in the repository's LICENSE file.
8 months ago
7 months ago
9 months ago
1 year ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago