# NPM Best Practices for Observable

**URL:** https://talk.observablehq.com/t/npm-best-practices-for-observable/350
**Category:** Help
**Created:** [February 15, 2018, 5:34pm UTC](https://talk.observablehq.com/t/npm-best-practices-for-observable/350 "2018-02-15T17:34:42Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![backspaces](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/backspaces/32/196_2.png) [@backspaces](https://talk.observablehq.com/u/backspaces)
#### Post date: [February 16, 2018, 5:49pm UTC](https://talk.observablehq.com/t/npm-best-practices-for-observable/350/3 "2018-02-16T17:49:29Z")

</div>

OK, we’ve got a first shot at a npm package: @redfish/agentscript.

It has both a umd and esm rollup.

> umd: [https://unpkg.com/@redfish/agentscript](https://unpkg.com/@redfish/agentscript)  
> esm: [https://unpkg.com/@redfish/agentscript?module](https://unpkg.com/@redfish/agentscript?module)

Observable: You can require the umd or import the esm. The short forms appear to work:

> umd = require(“@redfish/agentscript”)  
> esm = import(“@redfish/agentscript”)

(Not sure if this works if there is a user named “redfish”.)

Both long and short form are shown here:

> **[AgentScript: test es6 module import() and umd require()](https://observablehq.com/@backspaces/agentscript-test-es6-module-import-and-umd-require)**
>
> To require() the agentscript umd, either of these work: umd = require("agentscript") umd1 = require("https://unpkg.com/agentscript") And similarly for import() for modules esm = import("agentscript") esm1 =...

---

_[View the full topic](https://talk.observablehq.com/t/npm-best-practices-for-observable/350)._
